WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.X
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Arrarys in Dialogs

Keywords:   Arrarys in Dialogs 

Question:

I am trying to use a Array in a 6.1 dialog. The Arrary changes the font color and background color. But it does not seem to work. I have tried without the %'s Here is a snip of the code I am trying to use

{some code here...}

fontcolor = "255|255|0"
backcolor = "255|255|128"

{some code here...}

nums = 21
fontcolor = ArrDimension(nums)
backcolor = ArrDimension(nums)
for fnum = 0 to 20
fontcolor[fnum] = "255|0|0"
next fnum
for bnum = 0 to 20
backcolor[bnum] = "255|255|128"
next bnum

{some code here...}


DefaultNetwork003=`073,073,026,014,SPINNER,ip_1,"0",DEFAULT,6,%D1_1%,"Microsoft Sans Serif|6144|70|34","%fontcolor[0]%","%backcolor[0]%"`
DefaultNetwork004=`101,073,026,014,SPINNER,ip_2,"0",DEFAULT,7,%D1_2%,"Microsoft Sans Serif|6144|70|34","%fontcolor[1]%","%backcolor[1]%"`
DefaultNetwork005=`157,073,026,014,SPINNER,ip_3,"0",DEFAULT,9,%D1_3%,"Microsoft Sans Serif|6144|70|34","%fontcolor[2]%","%backcolor[2]%"`
DefaultNetwork006=`129,073,026,014,SPINNER,ip_4,"0",DEFAULT,8,%D1_4%,"Microsoft Sans Serif|6144|70|34","%fontcolor[3]%","%backcolor[3]%"`

Could someone let me know what I am doing wrong. Thanks

Answer:

The dialog function doesn't support arrays as parameters. You will need to store the array element off as a standard WIL variable....

The code might look something more like this:

fontcolor = "255|255|0"
backcolor = "255|255|128"
nums = 21

for fnum = 0 to 20
	fontcolor%fnum% = "255|0|0"
next fnum
for bnum = 0 to 20
	backcolor%bnum% = "255|255|128"
next bnum


MyDialogFormat=`WWWDLGED,6.1`

MyDialogCaption=`WIL Dialog 1`
MyDialogX=057
MyDialogY=105
MyDialogWidth=302
MyDialogHeight=171
MyDialogNumControls=004
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`

MyDialog001=`078,153,033,011,PUSHBUTTON,DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`191,153,033,011,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`044,036,022,009,SPINNER,spin1,"1",DEFAULT,3,DEFAULT,DEFAULT,"%fontcolor1%","%backcolor1%"`
MyDialog004=`078,036,022,009,SPINNER,spin2,"1",DEFAULT,3,DEFAULT,DEFAULT,"%fontcolor2%","%backcolor2%"`

ButtonPushed=Dialog("MyDialog")

Article ID:   W15453
File Created: 2003:05:13:11:28:04
Last Updated: 2003:05:13:11:28:04