PDA

View Full Version : Another new vaporware: multiline strings



ErosOlmi
07-10-2007, 22:50
What about a new mad feature: multiline feature made easy to create big strings. You just need to close with " at the end after many lines of code. This can be useful for CGI applications where you have to output HTML code.
Also concatenation and assignment using same notation as php, that is using point.

Example:


dim s as string

s = "This is a multiline string. Next thinBasic release
will support this kind of statements. Still some
features to be fixed like
- leave left spaces or tabs as formatted by user
- let thinAir understand multilines string
In any case, so far, this feature seems quite powerful.
"

s .= "----------------------------------------------------------------------
Strings can also be concatenated using . (point)
like in php scripting language
"

s .= "----------------------------------------------------------------------
Concatenation with . can also takes place in parsin.
Here for example you should see the number 100:" . str$(10*10) . "
and here the len of this string since it was before this last
concatenation: " . len(s) . $crlf

s .= "----------------------------------------------------------------------
What do you think? :D"

msgbox 0, s


Get attached thinCore.dll file and if you have some time to test, let me know results.

Thanks a lot
Eros

_________________________________________________
UPDATES:
2007.10.08: fixed incorrect delimiter error reported by Petr.


ADDED:
attached file removed. Feature already present in current thinBasic preview release.

Randall
08-10-2007, 01:28
I haven't had a chance to try it out, but I love the PHP style of using a "." for concatenation.

Straying a bit from the BASIC syntax, perhaps, but I'm not a BASIC purist so I don't mind doing things differently.

Randall

kryton9
08-10-2007, 01:40
Eros, it worked fine on this end. Nice new features, thanks!

Petr Schreiber
08-10-2007, 10:06
Hi Eros,

works here too :)

I like the multilining, "+ _ is also usable but this new way is faster, and as you said ideal for HTML and such a things :)


Thanks,
Petr

Petr Schreiber
08-10-2007, 13:12
Eros,

core you attached has some parsing engine problem :(
Try to execute following:


dim index as single
index = 10.1 + rnd


On my PC I get "Invalid delimiter" on second line, additional info reports "1513"


Petr

ErosOlmi
08-10-2007, 14:46
Thanks Petr, that's why we use "vaporware" announcements :D

Very strange, complex scripts run while this little beast not!
100% sure a dummy error from my late night programming sessions.

Thanks a lot. I will check at home this evening.

Ciao
Eros

ErosOlmi
08-10-2007, 15:50
Fixed. Attachment in first post of this thread updated.
As suspected a late night change: inversion of 2 equates.

Let me know.
Eros

Petr Schreiber
08-10-2007, 16:00
Now it works,

thanks a lot!


Petr