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
2 registered members (Quad, AndrewAMD), 996 guests, and 6 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
Page 1 of 2 1 2
Checking string "line break" (GER/ENG) #283882
08/10/09 15:18
08/10/09 15:18
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Hello!
I want a scrolling text, so I must check if there is a line break - because i only want to scroll when there is a line break. Is this Possible - I haven´t found anything in the manual...
---------------------------------
Hallo"
Ich möchte einen Scrollenden text machen und muss dafür kucken ob ein zeilen umbruch stattfindet damit ich den text abschneiden kann. Ist das möglich? - Ich habe nciht im Manual gefunden ...

Thanks,
Rei

Re: Checking string "line break" (GER/ENG) [Re: Rei_Ayanami] #283889
08/10/09 15:46
08/10/09 15:46
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Maybe you could use
Quote:

str_stri (String1, String2)

Returns the character number (beginning with 1) of the first case-insensitive occurrence of string2 in string1. If no occurence is found, 0 is returned.

http://www.conitec.net/beta/astr_stri.htm

and search for "\n" to find any line breaks.

Re: Checking string "line break" (GER/ENG) [Re: Xarthor] #283890
08/10/09 15:47
08/10/09 15:47
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
my strings look like this:
STRING* holograph_1_2 =
"Hey!
Sounds very cool!";

with line break wink

Re: Checking string "line break" (GER/ENG) [Re: Rei_Ayanami] #284704
08/14/09 17:23
08/14/09 17:23
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Anyone? I won´t spam this thread but i need this =)

Re: Checking string "line break" (GER/ENG) [Re: Rei_Ayanami] #284705
08/14/09 17:26
08/14/09 17:26
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
whitespace is not linebreak, you cannot check it.


3333333333
Re: Checking string "line break" (GER/ENG) [Re: Quad] #284709
08/14/09 17:38
08/14/09 17:38
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
any other option?

Re: Checking string "line break" (GER/ENG) [Re: Rei_Ayanami] #284716
08/14/09 18:07
08/14/09 18:07
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
woher kommt denn dein text? tippst du den vorher ein?

Ich habe (natürlich erst nachdem ich meine eigenen funktionen gecoded hatte und stunden damit vergeudet habe) die flag "WWRAP" beim text gefunden.
Das heißt, wenn in deinem Text nicht unbeding schon die line feeds drin sein müssen, kann 3dgs den text so anpassen. Scrollen kannst du dann indem du das ding vertikal über den screen bewegst.

Oder woher kommen deine strings? Wenn du sie selbst eintippst, im code, dann kannst du doch einfach statt nem linebreak ein \n hinschreiben...?


~"I never let school interfere with my education"~
-Mark Twain
Re: Checking string "line break" (GER/ENG) [Re: Germanunkol] #284717
08/14/09 18:20
08/14/09 18:20
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline OP
Expert
Rei_Ayanami  Offline OP
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Wie genau? Ich kann das nciht im Manual finden? Kannst du mir mal die übergebenen Daten, wie z.b."ent_create(und das hier mein ich)".

Danke aber laugh

Re: Checking string "line break" (GER/ENG) [Re: Rei_Ayanami] #284720
08/14/09 18:37
08/14/09 18:37
Joined: Dec 2008
Posts: 271
Saturnus Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
If you still need to find line breaks, you could search for the appropiate line break control characters (CR & LF) in your STRING:

Code:
char *char_array = your_string->chars;
int i;
	
for (i = 0; char_array[i]; i++)
{
	if ((char_array[i] == 13) && (char_array[i + 1] == 10))
	{
		printf("line break found at position %i", i + 1);
		i++;
	}
}



Re: Checking string "line break" (GER/ENG) [Re: Saturnus] #284732
08/14/09 19:12
08/14/09 19:12
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline
Expert
Germanunkol  Offline
Expert

Joined: Jun 2006
Posts: 2,640
Earth
falls du's noch brauchst:

im manual unter suchen 'wwrap' ohne ' eingeben, enter drücken. bei mir ist dann das erste "flags (text)". da drauf klicken, dann irgendwo in der mitte steht wwrap.


~"I never let school interfere with my education"~
-Mark Twain
Page 1 of 2 1 2

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