Post Reply 
71B: DIM a variable, but keep the old value if it's already the right type?
03-23-2021, 08:19 AM
Post: #4
RE: 71B: DIM a variable, but keep the old value if it's already the right type?
To answer the question in the title: "DIM a variable, but keep the old value if it's already the right type?", I would also use the TYPE keyword as Valentin suggested but the Math ROM is required.

An other solution, w/o Math ROM:
10 ON ERROR GOTO 30
20 X=X @ GOTO 40 ! check that X is a scalar variable
30 REAL X ! declare X of the right type if needed
40 OFF ERROR


J-F
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: 71B: DIM a variable, but keep the old value if it's already the right type? - J-F Garnier - 03-23-2021 08:19 AM



User(s) browsing this thread: 1 Guest(s)