Skip to main content

What are all the valid ways to quote literal strings when assigning them to variables in unibasic on Unidata?



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

What are all the valid ways to quote literal strings when assigning them to variables in unibasic on Unidata?



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

I use double quotes, single quotes, and backslashes.

"Hello"

'Hello'

\\Hello\\

of course the functions DQUOTE and SQUOTE can be useful too.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

I use double quotes, single quotes, and backslashes.

"Hello"

'Hello'

\\Hello\\

of course the functions DQUOTE and SQUOTE can be useful too.



------------------------------
David Green
Computer Programmer
Rocket Forum Shared Account
------------------------------

Thank you, David.

I knew there was at least one more way to do it.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

What are all the valid ways to quote literal strings when assigning them to variables in unibasic on Unidata?



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------

Shawn,

For consistency I never use a  '  but rather ".  

COLOR = "BLUE"   ;* preferred method of the "

COLOR = 'RED'    ;*  never used. 

COLOR = \\YELLOW\\   ;* never use to assign a variable but preferred method to execute a TCL statement or an Operating system command. 

STMT = \\SELECT FILENAME WITH COLOR = "BLUE" \\   ;* preferred method of the \\    It's much easier to read and easy on the eyes. 



------------------------------
Peter Gonzalez
Programmer/Systems Analyst/EDI Developer
Self Registered
St. Louis MO US
------------------------------

Shawn,

For consistency I never use a  '  but rather ".  

COLOR = "BLUE"   ;* preferred method of the "

COLOR = 'RED'    ;*  never used. 

COLOR = \\YELLOW\\   ;* never use to assign a variable but preferred method to execute a TCL statement or an Operating system command. 

STMT = \\SELECT FILENAME WITH COLOR = "BLUE" \\   ;* preferred method of the \\    It's much easier to read and easy on the eyes. 



------------------------------
Peter Gonzalez
Programmer/Systems Analyst/EDI Developer
Self Registered
St. Louis MO US
------------------------------

Great suggestions...thank you, Peter.

In the case that gave rise to my initial question, i have to use something other than a double quote since the string being defined will contain those.



------------------------------
Shawn Waldie
enterprise application developer
Rocket Forum Shared Account
Los Angeles CA US
------------------------------