[Implemented] Constants in data

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

[Implemented] Constants in data

Post by MrTAToad »

Continuing with datasections, it would be handy if constants could be used there too
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: Constants in data

Post by MrTAToad »

In addition, being able to use constants as default parameters in procedures would be useful to.
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: Constants in data

Post by Fred »

Both should work IIRC
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Constants in data

Post by Peter »

@MrTAToad:

1.)

Code: Select all

#ConstantWithValue1 = 1
#ConstantWithValue2 = 2

Read Value
Debug Value ; -> 1

Read Value
Debug Value ; -> 2

DataSection
  Data.i #ConstantWithValue1, #ConstantWithValue2
EndDataSection

2.)

Code: Select all

#ConstantWithValue1 = 1

Procedure Test(Parameter = #ConstantWithValue1)
  Debug Parameter
EndProcedure

Test() ; -> 1
Test(10) ; -> 10
Greetings ... Peter
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: Constants in data

Post by MrTAToad »

Yes, they are working now, which is good!
Post Reply