envvar naming

This forum is for general developer support questions.

envvar naming

Postby Raziel » Sun Nov 08, 2015 5:29 pm

Hi devs,

Are envvars limited to letters when using them in DOS scripts?
I tried to distinguish some vars by using a "." and the scripts started to act ill.

Example:
This script works as expected.
Code: Select all
requestchoice >ENV:rcnumtest "Test" "Test" "One" "Null/Cancel"

if $rcnumtest EQ 1
   echo "One"
   SKIP Finish
endif

echo "Null"

LAB Finish


While this script doesn't...
Code: Select all
requestchoice >ENV:rcnum.test "Test" "Test" "One" "Null/Cancel"

if $rcnum.test EQ 1
   echo "One"
   SKIP Finish
endif

echo "Null"

LAB Finish


Just want to know if it' s meant to be that "special" chars aren't allowed in envvars or if it's a limitation or maybe even a regression?

Thanks a lot
If slaughterhouses had glass walls, everyone would be a vegetarian. ~ Sir Paul McCartney
-
Did everything just taste purple for a second? ~ Philip J. Fry
-
Ain't got no cash, ain't got no style, ladies vomit when I smile. ~ Dr. John Zoidberg
User avatar
Raziel
 
Posts: 800
Joined: Sat Jun 18, 2011 5:00 pm
Location: A haunted Castle somewhere in the Bavarian Mountains

Re: envvar naming

Postby thomasrapp » Sun Nov 08, 2015 6:00 pm

You can enclose the variable name in braces (a.k.a. curly brackets) if you need special characters, for example ${rcnum.test}
User avatar
thomasrapp
 
Posts: 253
Joined: Sun Jun 19, 2011 12:22 am

Re: envvar naming

Postby Raziel » Mon Nov 09, 2015 7:29 am

Arrgh, i should have read the DOS manual before i start doing things...of course, stupid me

Thanks Thomas
If slaughterhouses had glass walls, everyone would be a vegetarian. ~ Sir Paul McCartney
-
Did everything just taste purple for a second? ~ Philip J. Fry
-
Ain't got no cash, ain't got no style, ladies vomit when I smile. ~ Dr. John Zoidberg
User avatar
Raziel
 
Posts: 800
Joined: Sat Jun 18, 2011 5:00 pm
Location: A haunted Castle somewhere in the Bavarian Mountains

Re: envvar naming

Postby ssolie » Tue Nov 10, 2015 1:32 am

thomasrapp wrote:You can enclose the variable name in braces (a.k.a. curly brackets) if you need special characters, for example ${rcnum.test}

I'm having a tough time finding this on the AmigaOS wiki.

Where was this documented in the original Amiga reference books?
AmigaOS Development Team Lead
Be authentic. Get AmigaOS.
User avatar
ssolie
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1000
Joined: Mon Dec 20, 2010 9:51 pm
Location: Canada

Re: envvar naming

Postby colinw » Tue Nov 10, 2015 8:52 am

http://wiki.amigaos.net/wiki/AmigaOS_Manual:_AmigaDOS_Using_Scripts

Under "Dot Commands", .bra and .ket can also redefine the character used.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 169
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.


Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 3 guests

cron