envvar naming

This forum is for general developer support questions.
Post Reply
Raziel

envvar naming

Post by Raziel »

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
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: envvar naming

Post by thomasrapp »

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

Re: envvar naming

Post by Raziel »

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

Thanks Thomas
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: envvar naming

Post by ssolie »

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?
ExecSG Team Lead
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 218
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: envvar naming

Post by colinw »

http://wiki.amigaos.net/wiki/AmigaOS_Ma ... ng_Scripts

Under "Dot Commands", .bra and .ket can also redefine the character used.
Post Reply