Author Topic: testing a posted code fragment  (Read 6089 times)

kdmoyers

  • Sr. Member
  • ****
  • Posts: 511
testing a posted code fragment
« on: May 02, 2013, 10:01:14 am »
Code: [Select]
  #definesubroutine ArrSetup(arr)
    ; Used to maintain a set of named array indexes
    ; globally across main program and functions.
    if arrinfo(arr,0)==1 ; one dimensional
      for _i = 1 to itemcount(arr[0],' ')
        _s = itemextract(_i,arr[0],' ')
        @%_s% = _i
      next _i
    elseif arrinfo(arr,0)==2 ; two dimensional
      for _i = 1 to itemcount(arr[0,0],' ')
        _s = itemextract(_i,arr[0,0],' ')
        @%_s% = _i
      next _i
    endif
    drop(_i,_s)
    return parr
    ;Usage in main program:
    ;   arrvar = ARRDIMENSION(100)
    ;   arrvar[0] = "FRED PETE SALLY"
    ;   ArrSetup(*PTRGLOBALDEFINE(arrvar))
    ;   . . .
    ;   arrvar[@SALLY] = 1234
    ;
    ;Usage in functions:
    ;   arrvar = ArrSetup(*PTRGLOBAL(arrvar))
    ;   . . .
    ;   X = arrvar[@SALLY]
    ;
  #endsubroutine

  mem = arrdimension(100)
  mem[0]="left top inifile speed"
  arrsetup(*ptrglobaldefine(mem))

  #definefunction fred(a)
    mem = arrsetup(*ptrglobal(mem))
    message(a,mem[@top])
  #endfunction

  mem[@top] = 45

  fred("sally")

exit
The mind is everything; What you think, you become.

kdmoyers

  • Sr. Member
  • ****
  • Posts: 511
Re: testing a posted code fragment
« Reply #1 on: May 02, 2013, 10:02:50 am »
Code: Winbatch
  #definesubroutine ArrSetup(arr)
    ; Used to maintain a set of named array indexes
    ; globally across main program and functions.
    if arrinfo(arr,0)==1 ; one dimensional
      for _i = 1 to itemcount(arr[0],' ')
        _s = itemextract(_i,arr[0],' ')
        @%_s% = _i
      next _i
    elseif arrinfo(arr,0)==2 ; two dimensional
      for _i = 1 to itemcount(arr[0,0],' ')
        _s = itemextract(_i,arr[0,0],' ')
        @%_s% = _i
      next _i
    endif
    drop(_i,_s)
    return arr
    ;Usage in main program:
    ;   arrvar = ARRDIMENSION(100)
    ;   arrvar[0] = "FRED PETE SALLY"
    ;   ArrSetup(*PTRGLOBALDEFINE(arrvar))
    ;   . . .
    ;   arrvar[@SALLY] = 1234
    ;
    ;Usage in functions:
    ;   arrvar = ArrSetup(*PTRGLOBAL(arrvar))
    ;   . . .
    ;   X = arrvar[@SALLY]
    ;
  #endsubroutine

  mem = arrdimension(100)
  mem[0]="left top inifile speed"
  arrsetup(*ptrglobaldefine(mem))

  #definefunction fred(a)
    mem = arrsetup(*ptrglobal(mem))
    message(a,mem[@top])
  #endfunction

  mem[@top] = 45

  fred("sally")

exit
 
The mind is everything; What you think, you become.

td

  • Tech Support
  • *****
  • Posts: 4382
    • WinBatch
Re: testing a posted code fragment
« Reply #2 on: May 03, 2013, 08:01:23 am »
Welcome! You have the 'honor' of being  the first WinBatch user to sign in to the new forum.  8)
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

kdmoyers

  • Sr. Member
  • ****
  • Posts: 511
Re: testing a posted code fragment
« Reply #3 on: May 06, 2013, 05:31:13 am »
Proud to be here.  Lemme know if I can help!
-Kirby
The mind is everything; What you think, you become.

myfairlady

  • Newbie
  • *
  • Posts: 2
Re: testing a posted code fragment
« Reply #4 on: August 22, 2013, 06:37:19 pm »
Hi there, please help me.

I use win batch to upload some data to Movex. I found some issue and got reply from win batch support. They give me some script to add. I don't know where can i add those script and how to fix. Please help me win batch expert. Thanks.
I am just normal end user and use winbatch for uploading purpose. I don't know which is source file and which IDE is required. Please help me. If my question  is wrong thread, feel free to move the post. Thanks.

Best Regards,
myfairlady

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: testing a posted code fragment
« Reply #5 on: August 23, 2013, 07:45:49 am »
Hi there, please help me.

I use win batch to upload some data to Movex. I found some issue and got reply from win batch support. They give me some script to add. I don't know where can i add those script and how to fix. Please help me win batch expert. Thanks.
I am just normal end user and use winbatch for uploading purpose. I don't know which is source file and which IDE is required. Please help me. If my question  is wrong thread, feel free to move the post. Thanks.

Best Regards,
myfairlady

Notice: When posting to this forum you should post all WinBatch questions to the WINBATCH board.

WinBatch source files have the extension .WBT. The WinBatch Studio is the IDE to develop your WinBatch scripts.

If you plan on writing or modifying WinBatch scripts, it recommend that you start by reading the WIL Tutorial. This tutorial is located in the Consolidated WIL help file that is listed under WinBatch on your Start Menu. Otherwise you should contact the developer of the script to make any modifications.
Deana F.
Technical Support
Wilson WindowWare Inc.