September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
16
Task/Dynamic-variable-names/Phix/dynamic-variable-names.phix
Normal file
16
Task/Dynamic-variable-names/Phix/dynamic-variable-names.phix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
constant globals = new_dict()
|
||||
|
||||
while 1 do
|
||||
string name = prompt_string("Enter name or press Enter to quit:")
|
||||
if length(name)=0 then exit end if
|
||||
integer k = getd_index(name,globals)
|
||||
if k=0 then
|
||||
string data = prompt_string("No such name, enter a value:")
|
||||
setd(name,data,globals)
|
||||
else
|
||||
string data = prompt_string(sprintf("Already exists, new value[%s]:",{getd(name,globals)}))
|
||||
if length(data) then
|
||||
setd(name,data,globals)
|
||||
end if
|
||||
end if
|
||||
end while
|
||||
Loading…
Add table
Add a link
Reference in a new issue