MapCreate

Started by bmclellan, April 30, 2020, 12:39:20 PM

Previous topic - Next topic

bmclellan

Hello,

I've been checking out the MapCreate function, but not having much luck.

From the help file, if I run Example 1, or Example 2
Example 1:
   Pairs = 'Apples,0':@tab:'Oranges,0':@tab:'Pears,0'
   Fruit = MapCreate(Pairs)
   ; Count an apple.
  Fruit["apples"] += 1

I get an error ArrDimension: Unable to allocate or lock memory.

I'm on the latest version:  2020A Jan 8, 2020

Thanks!
Barry







td

I would imagine that you are running the example using WinBatch Studio's debugger. Running the example outside the debugger works just fine.  However, the debugger is known to cause problems with WIL maps.   Until the next release, you will have to play with WIL maps outside the debugger.

Thanks for reporting the problem.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

While staring mindlessly out the window I realized I should have mentioned a workaround that allows you to use maps in the debugger. All you need is the top secret IntControl 100

Code (winbatch) Select
IntControl(100, 64,0,0,0)

Pairs = 'Apples,0':@tab:'Oranges,0':@tab:'Pears,0'
Fruit = MapCreate(Pairs)
; Count an apple.
Fruit["apples"] += 1


[edit]
The link to IntControl 100 documenation:
https://docs.winbatch.com/mergedProjects/WindowsInterfaceLanguage/html/IntControl_100.htm
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bmclellan