Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, The_Judge, Grant), 898 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
text field with more lines? #144829
07/31/07 23:41
07/31/07 23:41
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Im trying to make a text field with more lines

why doesnt this work? well actually it works but not how i want it to...

it only works once. Only when i clicked the button to insert the text. i can go one line back not more..when i press enter/return after going back to previous line the inkey is set off.

Code:

starter next_line
{
while(1)
{
if(key_lastpressed == 28 && line_num < 14) //28 = return,enter
{
beep;
inkey_active = off;
line_num += 1;
wait(1);
inkey(test_txt.string[line_num]);
}
wait(1);
}
}

starter vorige_regel
{
while(1)
{
if(key_lastpressed == 14 && str_cmpi(test_txt.string[line_num],"") == 1 && line_num > 0) //14 = bksp
{
beep;
inkey_active = off;
line_num -= 1;
wait(1);
inkey(test_txt.string[line_num]);
key_lastpressed = 15;
}
wait(1);
}
}



Re: text field with more lines? [Re: Toon] #144830
08/01/07 01:19
08/01/07 01:19
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Are there not a var or array and text object missing from this sample?


smile
Re: text field with more lines? [Re: D3D] #144831
08/01/07 15:40
08/01/07 15:40
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
there is a string

and a text define ...it all works..with more lines etc. but the backspace just doesnt work ..(only works once)

Re: text field with more lines? [Re: Toon] #144832
08/01/07 16:02
08/01/07 16:02
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
What my goal is, is to learn how to create a multiline textfield inside gamestudio with c-script.

I tryed a lot of different approaches but until now none of them worked correctly. If anyone has an idea how to do this please reply.

Re: text field with more lines? [Re: Toon] #144833
08/01/07 18:11
08/01/07 18:11
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
one thing that strikes me is the line that says key_lastpressed = 15;. key_lastpressed is read-only, so that may be giving you some problems. But maybe not.

Otherwise, I'm a big promoter of the breakpoint function. It's a great tool for debugging and figuring out what the heck is going on in your script, and it's led me weeping to my knees with the solution to a week-long bug hunt (kidding, but seriously). Just for now, I'd replace the beep; lines in both of your functions with breakpoint;. See what magic the debugger can perform for you.

Re: text field with more lines? [Re: LogantheHogan] #144834
08/02/07 15:12
08/02/07 15:12
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Yeah i tryed that and it is read-only maybe but its no problem redefining it in the game. I did that to quit the while loop and only execute the instructions needed once.
Code:

if(key_lastpressed == 14)



Re: text field with more lines? [Re: Toon] #144835
08/02/07 15:46
08/02/07 15:46
Joined: Sep 2002
Posts: 700
Orange County, CA
L
LogantheHogan Offline
Developer
LogantheHogan  Offline
Developer
L

Joined: Sep 2002
Posts: 700
Orange County, CA
gotcha. Well did you try a breakpoint?

Re: text field with more lines? [Re: LogantheHogan] #144836
08/02/07 16:06
08/02/07 16:06
Joined: Nov 2003
Posts: 433
The Netherlands
T
Toon Offline OP
Senior Member
Toon  Offline OP
Senior Member
T

Joined: Nov 2003
Posts: 433
The Netherlands
Well im still checking stuff out a little bit but i figured the instructions are only executes once (how i wanted it to). I dont see any mistakes/error or wrong executed code but still it doesnt act right


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1