Changeset d6065b5 in tol
- Timestamp:
- Jun 10, 2009, 4:07:24 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 510f3f8
- Parents:
- 3109e3a
- File:
-
- 1 edited
-
tol/stdlib/general/various/_tools.tol (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/general/various/_tools.tol
r3109e3a rd6065b5 49 49 50 50 //////////////////////////////////////////////////////////////////////////////// 51 Anything getOptArg( SetoptArgs, Text name, Anything defValue)51 Anything getOptArg(Anything optArgs, Text name, Anything defValue) 52 52 //////////////////////////////////////////////////////////////////////////////// 53 53 { 54 If(!Card(optArgs), defValue, 55 { 56 Real Do If(Card(optArgs),!HasIndexByName(optArgs),SetIndexByName(optArgs)); 57 Real idx = FindIndexByName(optArgs,name); 58 If(!idx, defValue, optArgs[idx]) 59 }) 54 Text g = Grammar(optArgs); 55 Case( 56 g=="Set", 57 If(!Card(optArgs), defValue, 58 { 59 Real Do If(Card(optArgs),!HasIndexByName(optArgs),SetIndexByName(optArgs)); 60 Real idx = FindIndexByName(optArgs,name); 61 If(!idx, defValue, optArgs[idx]) 62 }), 63 g=="NameBlock", 64 If(!ObjectExist("Anything","optArgs::"+name), defValue, 65 Eval("optArgs::"+name)), 66 1==1, 67 { 68 WriteLn("Non allowed type "+g+" for argument optArgs of function getOptArg", 69 "E") 70 } 71 ) 60 72 }; 61 73 ////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.
