Precisely Speaking
May 21, 2012, 06:59:05 PM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: So what's news with you? Tell us about it in "Getting To Know You"!
Home
Help
Calendar
Login
Register
Precisely Speaking
>
Training and Education
>
SB+ Programming Questions
>
Assigning Strings with Semi-Colons in Paragraphs
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Assigning Strings with Semi-Colons in Paragraphs (Read 823 times)
Tom Pellitieri
Rock Star
Posts: 171
Tom Pellitieri - Toledo, Ohio
Assigning Strings with Semi-Colons in Paragraphs
«
on:
January 11, 2011, 07:37:38 AM »
I'm using SB+ 5.4.3. In /PD.P, I tried to enter the following two lines:
LOCAL TMP
TMP = "X;Y"
When I press F2 to save, I get an error "Line 2 - Error in Expression".
If I removed the semi-colon, it's fine.
Any ideas?
??
I'm actually trying to set @PARAM before a call to SB.EVAL.EXP to get the text from a Code Table (/TABLE.DEFN). Alternatively, is there an easier way to do this from a paragraph?
--Tom
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
Posts: 1532
Re: Assigning Strings with Semi-Colons in Paragraphs
«
Reply #1 on:
January 11, 2011, 07:43:56 AM »
The SB+ paragraph parser thinks a semicolon can only be a statement terminator and therefore it cannot appear in a quoted string. The semicolon character is a ASCII 59 (as I recall) so you can either concatenate a CHAR(59) where you want the semicolon to be, or you can create a global equate called SEMICOLON or SEMI that equates to CHAR(59) and use that name instead (which I think is more readable).
Logged
-Kevin
Accidents "happen"; success, however, is planned and executed.
Tom Pellitieri
Rock Star
Posts: 171
Tom Pellitieri - Toledo, Ohio
Re: Assigning Strings with Semi-Colons in Paragraphs
«
Reply #2 on:
January 11, 2011, 11:38:43 AM »
Thanks, Kevin. I don't use the semi-colon/statement separator much. I just found it odd that the parser would give that precedence over string completion.
Logged
precisonline
President/Chief Technologist
Administrator
Rock Star
Posts: 1532
Re: Assigning Strings with Semi-Colons in Paragraphs
«
Reply #3 on:
January 11, 2011, 12:34:03 PM »
Very few actually use the string separator. But the problem is deeper than the paragraph language; it's actually in the underlying expression language. For example, this is invalid in a SB+ expression:
SEQ(';')
It's perfectly valid in BASIC, however. The semicolon just messes stuff up.
My apologies, I remember now it's not because of the statement separator, it's because of the way that SB+ creates execution stacks from this stuff. The semicolon is the delimiter both for expressions and paragraph p-code. For example, here's the execution stack for SEQ('A'):
CA;Z|Q
Note the ";" between the "constant A" and "function Q".
Logged
-Kevin
Accidents "happen"; success, however, is planned and executed.
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Getting To Know You
=> Announcements
=> Big Thoughts / Cool Ideas
=> Rants & Raves
-----------------------------
Application Support
-----------------------------
=> Red Leaf
=> Activant/Prelude Support
=> Summit Support
=> Avante Support
=> PRC Support
-----------------------------
Training and Education
-----------------------------
=> Connect!
=> U2 Programming Questions
=> SB+ Programming Questions
=> Web Programming Questions
=> Business Intelligence / MITS
=> PC / Hardware / Miscellaneous Support
Loading...