Page 1 of 1 1
Topic Options
#90851 - 2003-01-08 12:32 AM kiXforms question
Ghost Offline
Starting to like KiXtart

Registered: 2000-09-14
Posts: 171
For my next project, (which you guys are going to love!!!) I need to create an array to store new kiXform controls, however I'm having difficulty getting this to work.

Heres some code:

code:
$ctrlarray[$ctrlcount].width = $ctrlWidth.text
$ctrlarray[$ctrlcount].height = $ctrlHeight.text

And I get this error:

code:
Script error: unknown or unexpected command []!
$ctrlarray[$ctrlcount].width = $ctrlWidth.text

Any ideas.

Once I get this little bit of my code sorted I'll be posting a beta version of my script for you to test.

[Smile]
_________________________
Who are you? Who slips into my robot body and whispers to my ghost?

Top
#90852 - 2003-01-07 01:11 PM Re: kiXforms question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ghost ,

I don't think that you can do that (right now with the current versions)

You try to reference kixforms controls by array elements ... Really tricky , got to think over
_________________________



Top
#90853 - 2003-01-07 01:25 PM Re: kiXforms question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
got it in already!
quess first bbCheckerII having such was 1.0

anyway, have you initialized the array?
nowadays these kix-errors look pretty weird but that is first thing that comes to mind.

if your $ctrlarray is not dimmed or globalized as array, or passed an array, similar error would occure...
_________________________
!

download KiXnet

Top
#90854 - 2003-01-07 02:00 PM Re: kiXforms question
Ghost Offline
Starting to like KiXtart

Registered: 2000-09-14
Posts: 171
Damit!!!

DIM'ed my array instead of GLOBALing it.

How stupid am I.

[Frown]
_________________________
Who are you? Who slips into my robot body and whispers to my ghost?

Top
#90855 - 2003-01-07 02:05 PM Re: kiXforms question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ahhh,
a Scope Issue .. Looking forward to see the beta script !

J.
_________________________



Top
#90856 - 2003-01-07 03:48 PM Re: kiXforms question
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I still don't think you can use this type of variable syntax.
_________________________
There are two types of vessels, submarines and targets.

Top
#90857 - 2003-01-07 04:03 PM Re: kiXforms question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Jens,

I have to disagree :



break on

global $ctrls[5]

$form         = createobject("Kixtart.Form")
$form.Caption = "Control Arrays"

for $i = 0 to ubound($ctrls)
   $ctrls[$i]            = "btn$i","MyFunction($i)"
   $ctrls[$i][0]         = $form.Button("Button $i",20,$i*30,80,25)
   $ctrls[$i][0].On Click = "" + $ctrls[$i][1]
next

$form.show

while $form.Visible
   $ = execute($form.DoEvents)
loop

quit ()

function MyFunction($i)
   $box = $form.MsgBox("Button # $i was clicked","Button down",64)
endfunction




Jochen

PS: remove the space in On Click

[ 07. January 2003, 16:06: Message edited by: jpols ]
_________________________



Top
#90858 - 2003-01-07 04:19 PM Re: kiXforms question
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
thanks jochen.
as multiple times proven, this indeed works.
_________________________
!

download KiXnet

Top
#90859 - 2003-01-07 04:23 PM Re: kiXforms question
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hmmm - i really like that color scheme you got there Captain - not too sure about the purple/pink color for functions though - maybe tone that down a little bit. Got a newer version of your PostPrep out there ?
Top
#90860 - 2003-01-07 04:30 PM Re: kiXforms question
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
yeah ... thats just my personal favorite color (In my Ultraedit the background is light grey, therefore it looks a bit better)

Newer version ... yes , but still there are bugs/unwanted effects I have to ship around [Roll Eyes]

maybe at weekend ? We'll see [Wink]
_________________________



Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.066 seconds in which 0.032 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org