[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2005-10-31T21:14:56-05:00 http://petesqbsite.com/phpBB3/app.php/feed/topic/1133 2005-10-31T21:14:56-05:00 2005-10-31T21:14:56-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8999#p8999 <![CDATA[What does this mean?]]> Statistics: Posted by Guest — Mon Oct 31, 2005 9:14 pm


]]>
2005-10-31T20:27:49-05:00 2005-10-31T20:27:49-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8994#p8994 <![CDATA[What does this mean?]]>

Statistics: Posted by Rattrapmax6 — Mon Oct 31, 2005 8:27 pm


]]>
2005-10-31T19:44:08-05:00 2005-10-31T19:44:08-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8992#p8992 <![CDATA[What does this mean?]]>

Code:

q = 200 PRINT LEFT$(LTRIM$(RTRIM$(STR$(q))), 1)
1. It takes the STR$ of 200, which gives us a string of 4 characters, a space and 200.

2. Next it does the RTRIM$ which doesn't do anything because we have no trailing spaces. So we still have a space and 200.
3. Now it does the LTRIM$, which removes the leading space. We now have 3 characters, 200.

4. Now it does the LEFT$ on these 3 characters grabbing only the first character as specified by the ",1". So, the final result is 2.

It performs these functions in that order because, in the order of the parenthesis, each function needs a value or a string on which to operate. The STR$ goes first since it has the value of q to work with. Then the RTRIM$ works on the string result of the STR$, and so on.
*****

Statistics: Posted by moneo — Mon Oct 31, 2005 7:44 pm


]]>
2005-10-31T18:26:27-05:00 2005-10-31T18:26:27-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8988#p8988 <![CDATA[Re: What does this mean?]]>
What does LTRIM$ , RTRIM$, and STR$ mean?
example...LEFT$(LTRIM$(RTRIM$(STR$(q))), 1)
What would that do?
LTRIM$ trims off wightspaces(or spaces) left of a string:

Code:

String = "     Hello     "NewString = LTRIM$(String)NewString = "Hello    "
RTRIM$ does the same just for the right side:

Code:

NewString = "    Hello"
STR$ turns a numerical variable to a string.

Code:

Var = 100String = STR$(Var)String = "100"
As for the code:

Code:

q = 200PRINT LEFT$(LTRIM$(RTRIM$(STR$(q))), 1)
Output is: 2

:wink:

Statistics: Posted by Rattrapmax6 — Mon Oct 31, 2005 6:26 pm


]]>
2005-10-31T16:10:50-05:00 2005-10-31T16:10:50-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8983#p8983 <![CDATA[What does this mean?]]> Statistics: Posted by Kyle — Mon Oct 31, 2005 4:10 pm


]]>
2005-10-31T16:01:07-05:00 2005-10-31T16:01:07-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8982#p8982 <![CDATA[What does this mean?]]>
Converts a variable into a string. Adds a leading space for signing (+/-)

Code:

string$="Test "+LTRIM$(STR$(123))PRINT string$
Except string is a reserved keyword and that code would never run :wink:

Statistics: Posted by Xerol — Mon Oct 31, 2005 4:01 pm


]]>
2005-10-31T15:46:23-05:00 2005-10-31T15:46:23-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8980#p8980 <![CDATA[What does this mean?]]>

Code:

string$="Test "+LTRIM$(STR$(123))PRINT string$

Statistics: Posted by Kyle — Mon Oct 31, 2005 3:46 pm


]]>
2005-10-31T15:20:24-05:00 2005-10-31T15:20:24-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8978#p8978 <![CDATA[What does this mean?]]>
LTRIM cuts off all left spaces. RTRIM cuts off all right spaces EG

Code:

PRINT LTRIM$(RTRIM$("     I have extra spaces!             "));
Would ouput "I have extra spaces!". As for STR$, I dunno off hand. You can look it up.

Statistics: Posted by {Nathan} — Mon Oct 31, 2005 3:20 pm


]]>
2005-10-31T14:55:27-05:00 2005-10-31T14:55:27-05:00 http://petesqbsite.com/phpBB3/viewtopic.php?p=8976#p8976 <![CDATA[What does this mean?]]> example...LEFT$(LTRIM$(RTRIM$(STR$(q))), 1)
What would that do?

Statistics: Posted by Guest — Mon Oct 31, 2005 2:55 pm


]]>