Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / hidden text commands

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Nov 2004 02:58 Edited at: 30th Nov 2012 04:18
apparently, DBP does have a substring command. Well, it doesn't retrieve it, but it tells you the position of the first occurance of the substring you're searching for. There's a few other hidden goodies as well.



"You're not going crazy. You're going sane in a crazy world!" ~Tick
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Nov 2004 03:02 Edited at: 14th Nov 2004 03:45
Here's some other hidden commands I've found but haven't tested. Also, I'm using ver.5.5.

3DS2X "c:thing.3ds", "c:thing.x"

COMPILE CSG "input X file", "ouput X file"
COMPILE CSG "input X file", "ouput X file", EPSILON

don't know what this does
PRINTC
string = FREE STRING()

WRITE FILEMAP VALUE "filemap name", "value"
WRITE FILEMAP STRING "filemap name", "string"
dword = READ FILEMAP VALUE("filemap name")
string = READ FILEMAP STRING("filemap name")

dword = EXECUTE EXECUTABLE("filename", "commandline", "directory")
STOP EXECUTABLE dword_executable_id
integer = EXECUTABLE RUNNING(dword executable_id)

SAVE ICON FROM IMAGE "filename", img_number
DELETE ICON dword_icon_handle
dword = LOAD ICON("filename")

integer = WINDOW EXIST "window name"
WINDOW TO BACK ?
WINDOW TO BACK "window name"
WINDOW TO FRONT ?
WINDOW TO FRONT "window name"


Ok, that's all I found. There could be functions that didn't show up in the string tables, like "text3d", but without the string table there's no point in mentioning them.

"eureka" - Archimedes
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Nov 2004 03:04
FOR THE LOVE OF GOD WHY AREN'T THESE IN THE DOCS?!

Chris K
20
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 14th Nov 2004 03:10 Edited at: 14th Nov 2004 03:12
They're untested so could have memory leaks etc. Probably don't but TGC don't want any more big reports.

Don't work in my version
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 14th Nov 2004 03:31 Edited at: 14th Nov 2004 03:33
Chris K, Your Right
But I Have Pro With (I Think) All The Updates!!!

Hi Phaelax
Do you need to Call a Dll or something For these?

I Was Trying to do a Dll to 'TRY' and convert some POWERBasic Commands Like These


The only Problem is that Ive never Made a Dll before so This was going to be my First one.
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 14th Nov 2004 03:37
Count letter I saw was the first one.. Whats the different between that and "len()"?

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 14th Nov 2004 03:46
No, I don't need them. I started looking through them to see if there were any other token commands, which there wasn't. Guess I'll just use my own code, which I wrote a long time ago anyway.

"eureka" - Archimedes
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 14th Nov 2004 05:39
Quote: "COMPILE CSG "input X file", "ouput X file"
COMPILE CSG "input X file", "ouput X file", EPSILON"


These commands are obsolete, and will be until U6/U7 as I found out a long while back. Too bad to.



A book? I hate book. Book is stupid.
(Formerly known as Yellow)
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 14th Nov 2004 06:29
What Would I Lose If I Remove the Plugins U6/U7?

If its Object Commands, Then I Can loose them, (I Dont Use Object)
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 03:57 Edited at: 15th Nov 2004 03:59
Hi Everyone

As I Hate it When Code Commands are Disabled, Ive Made Some New String Commands, But require a Little Help.
The Function [GetFirstWord()] Works, But [Get Last word Returns Nothing]?
Can anyone see why?

Command List...

The Code
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 04:08 Edited at: 15th Nov 2004 05:02
MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 04:33 Edited at: 15th Nov 2004 05:26
SplitStringBefore()
SplitStringAfter()
GetFirstWord()
GetLastWord()
GetWordFromChr()
GetWordBeforeChr()
Reverse()
GetWord()



Most Works now
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 05:50
"Most"?

MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 05:56
Im having some problems with 2 Functions

GetWordBeforeChr(String$,Chr)
GetWord(S$,Wn)

Update Here:


Discription Of RegisterWordEnd(Chr$)
With the Word Commands, It take it that the Word has Ended If the Next Chr is one that in the Array, Set By the Function [RegisterWordEnd(Chr$)], Iv'e Set "" And " " And ","
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 07:01
Would that last function not work a little easier by doing a kind of "explode" command like in PHP..

Basically, you give a function a single or set of delimters (like your "", " ", ",", ":") and it makes an array of words from the string broken up by those delimters. Then your getWord function grabs the word at the position (or nearest if out of bounds?)

MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 07:54 Edited at: 15th Nov 2004 07:55
Hi Nicholas

Nice Thought, Might Give it a Try

Update:

Function List

Updated Code


Its all working Except
SearchStringForChr()
LocationOfWord()
GetWordBeforeChr()
The Word Commands are kind of Tricky

Sorry to be a Pain with These, But I dont do 3D, I Just Code, so Additional Text Commands are handy to me...
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 08:54 Edited at: 15th Nov 2004 08:56
Hehe.. I try to do both

The way I'd do word seaching is "template based"..

So, start at letter 1 and make a word from the next "n" letters in the string where "n"=length of word being looked for.
EG:
String: ABCDEFGHIJKLMNOPQRSTUVWXYZ
To Find: EFG

So, first test would be "ABC".. Does "ABC" = "EFG"? No.. Ok, find n letters starting from character 2.. Does "BCD"="EFG"?No.. Ok, try from position 3: "CDE"=EFG? No.. Pos 4:"DEF"=EFG"? No.. P5:"EFG"=EFG"? YES!! So it is found...

That is fairly easily done using nested for loops and mid$..

Psuedo code alert:


Something like that? I'm tired so soz if its all dogz bolls..

Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 09:13
PS: A VERY useful command, if you're a coder not a 3D man would be a string -> float command

Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Nov 2004 10:50 Edited at: 15th Nov 2004 10:50
A string to float command? Why not just use the val() command.

*note it will not be exactly the same value as some numbers can't be perfectly represented as floats.

Jess T
Retired Moderator
20
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Nov 2004 11:31
Those string commands that Phaelax posted I remember seeing a while back.

Dunno who posted them, or where I saw them, but someone just posted saying that there were all these new string commands in DBP !

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 17:41 Edited at: 15th Nov 2004 17:41
@TCA:

From the manual
Quote: "VAL
This command will return an integer number of the string provided by converting the string to a numerical form.

SYNTAX
Return Float=VAL(String)"


And a test prog:


On mine using V5.7 that prints out 52. Val does ints, EVENTHOUGH the manual claims floats.. and int.. Basically, the manual is wrong and right simultaneously!

MSon
19
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 15th Nov 2004 21:27
Hi Again.

Now Ive done some More Function, 1 that breaks up a String over Multiple Lines, And then Another Function that 'Wraps' the Lines to make it look neat...

List of Commands


Just out of curiosity, are these commands useful to anyone?

Code Here
Nicholas Thompson
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 15th Nov 2004 23:12
I'm sure they will be at some point!

Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 18th Nov 2004 09:51
Quote: "3DS2X "c:thing.3ds", "c:thing.x""


This is one of the most useful (hidden) commands in the Classic version, I didn't know they carried it over to Pro! Thanks for the heads-up. I found the command listed in the appendix of the only DB programming book I've been able to find so far. I've been able to use it over and over to convert .3DS objects (free, purchased, etc.) to .X when other modeling programs, and even DBPro, would barf on them.

Login to post a reply

Server time is: 2024-05-25 22:43:22
Your offset time is: 2024-05-25 22:43:22