envvar naming

This forum is for general developer support questions.
Post Reply
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

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
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

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}
User avatar
Raziel
Posts: 1170
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

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
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
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: 207
Joined: Mon Aug 15, 2011 9: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