Gamestudio Links
Zorro Links
Newest Posts
zorro license, IB connection
by miwok. 12/06/23 16:32
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
5 registered members (miwok, AndrewAMD, TipmyPip, 3run, 1 invisible), 633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Text Dialog #111297
02/07/07 15:29
02/07/07 15:29
Joined: Dec 2006
Posts: 28
U
user13 Offline OP
Newbie
user13  Offline OP
Newbie
U

Joined: Dec 2006
Posts: 28
how do you make a string show its characters one at a time.

Re: Text Dialog [Re: user13] #111298
02/07/07 15:31
02/07/07 15:31
Joined: Nov 2004
Posts: 1,011
South Africa
capanno Offline
Serious User
capanno  Offline
Serious User

Joined: Nov 2004
Posts: 1,011
South Africa
what do you mean? the a string "abcd" will display adcd. Please elaborate.

Re: Text Dialog [Re: capanno] #111299
02/07/07 15:38
02/07/07 15:38
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
I think he means just one letter


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Re: Text Dialog [Re: Puppeteer] #111300
02/07/07 15:46
02/07/07 15:46
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
I think he means show the characters one by one
of the string.

Re: Text Dialog [Re: vlau] #111301
02/07/07 17:03
02/07/07 17:03
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Not tested, tell me if something doesn't work. I'm not sure about the string = string; instructions... that's given me errors before. If it does, I think it means the strings need to be defined in different ways (without the [number] etc)
try it...

Code:
 

font standard_font = "Courier New",3,18;
string display_string[3];

text display_text
{
layer = 10;
pos_x = 10;
pos_y = 10;
string = display_string;
font = standard_font;
}


function show_letters(the_string)
{
string take_apart_string;
take_apart_string = the_string;
string temp_string;
display_text.visible = on;
var intcount;
while(intcount < len(the_string)) //go through the string
{
temp_string = take_apart_string;
str_trunc(temp_string,len(temp_string)-1); //take out the first letter only.
display_string = temp_string;
str_clip(take_apart_strin,1); //take the first letter out of the string, and leave the rest.
sleep(2);
}
display_text.visible = off;
}



function main()
{

//...

show_letters("letter by letter...");

}






~"I never let school interfere with my education"~
-Mark Twain
Re: Text Dialog [Re: Germanunkol] #111302
04/28/07 04:31
04/28/07 04:31
Joined: Jul 2006
Posts: 91
Florida, USA
Knuckles Offline
Junior Member
Knuckles  Offline
Junior Member

Joined: Jul 2006
Posts: 91
Florida, USA
Quote:

Not tested, tell me if something doesn't work. I'm not sure about the string = string; instructions... that's given me errors before. If it does, I think it means the strings need to be defined in different ways (without the [number] etc)
try it...

Code:
 

font standard_font = "Courier New",3,18;
string display_string[3];

text display_text
{
layer = 10;
pos_x = 10;
pos_y = 10;
string = display_string;
font = standard_font;
}


function show_letters(the_string)
{
string take_apart_string;
take_apart_string = the_string;
string temp_string;
display_text.visible = on;
var intcount;
while(intcount < len(the_string)) //go through the string
{
temp_string = take_apart_string;
str_trunc(temp_string,len(temp_string)-1); //take out the first letter only.
display_string = temp_string;
str_clip(take_apart_strin,1); //take the first letter out of the string, and leave the rest.
sleep(2);
}
display_text.visible = off;
}



function main()
{

//...

show_letters("letter by letter...");

}








Weird, I get errors with these lines:

string take_apart_string;
take_apart_string = the_string;
string temp_string;

Why does it keep saying parameter unknown? I tried defining them inside and outside the function, but it keeps coming up with the same error. I would think it wouldn't do that since it's all being defined as strings anyway. Here's the screen:



Last edited by Knuckles; 04/28/07 04:32.
Re: Text Dialog [Re: Knuckles] #111303
04/29/07 08:50
04/29/07 08:50
Joined: Oct 2004
Posts: 1,655
T
testDummy Offline
Serious User
testDummy  Offline
Serious User
T

Joined: Oct 2004
Posts: 1,655
I believe, local strings can not be defined in C-Script.
Also, to my knowledge, strings are not 'legitimately copied' through assignment operators in C-Script.


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