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.

Newcomers DBPro Corner / Running Strings As A Command?

Author
Message
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 13th Apr 2005 06:15
Is there any way to do a code like this



or



Thanks
Ace Of Spades
19
Years of Service
User Offline
Joined: 6th Mar 2005
Location: Across the ocean
Posted: 13th Apr 2005 06:40 Edited at: 13th Apr 2005 06:42
not easily

you would have to search the string for a specific command and if its found than manually print out what the result should be.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 13th Apr 2005 06:43
No, it can't be done. What you CAN do, is save that string into a file and run the file using this: http://forum.thegamecreators.com/?m=forum_view&t=49685&b=5

PowerSoft also has a similar one, dunno how that works though.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 13th Apr 2005 06:48
Hmm thanks for that. I'm downloading that TKF15H program currently but i prefer to make games without dlls

@Apolloed how do you do that?
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 13th Apr 2005 06:52
Xlaydos, it's not just a DLL, it's a plugin. When you download it, extract the DLL into the Compiler\plugins-user folder. Your game won't need the DLL later on because it gets embedded into your final program.
Look into the Compiler\Plugins folder. See all those DLLs? They're all plugins that do different things. Same as the link I just posted.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 13th Apr 2005 07:11
Yes i downloaded. Is there a tutorial anywhere?
Ace Of Spades
19
Years of Service
User Offline
Joined: 6th Mar 2005
Location: Across the ocean
Posted: 13th Apr 2005 07:27
Quote: "
@Apolloed how do you do that?"


Well it looks like you do not need to do it as TKF15H has done it publically already.
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 13th Apr 2005 08:31 Edited at: 13th Apr 2005 08:43
there's a Documentation.TXT file with it, but there isn't a real tutorial. The example program should be enough. It's pretty simple to use.

[edit] if you want, you can add me to your MSN, I'll give you a hand.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 14th Apr 2005 04:44
I don't have MSN :S Also, i am new to plugins. How do you install / use them?
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 14th Apr 2005 06:08
To install a plugin, extract the DLL into the
DarkBasicPro\compiler\plugins-user
folder. After you do this, new commands or functions will be added to DBP.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 15th Apr 2005 02:39
Okay thanks i understand that now How do you save a string / strings into a .wbc document?

Also, Do you know how to get a string, and read it letter by letter (very simple encyrpting)?

Is there a way to do this with an image and get the rgb color pixel by pixel as well?

Thanks
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 16th Apr 2005 23:16
back to the top
TKF15H
21
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 18th Apr 2005 12:56
Sorry I didn't reply sooner.
Regarding the first question, take a look at the following commands in the help window:
open to write FileNumber, "FileName.wbc"
write string FileNumber, "x=0"
close file FileNumber

As for the second question... there's no easy way to do it. You'll have to make a function that reads each letter using Inkey$() and adding each letter to a string ( text=text+inkey$() )

I'm not too sure what you're asking in the third question. You want to get the pixel colors of an image? If so, you need to convert the image into a memblock and read the data from there.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 18th Apr 2005 13:45 Edited at: 22nd Apr 2005 14:42
Xlaydos,

I feel I should stress to you to look into DarkBasic's commands listing, within the help files. The question you asked about string manipulation tells me you haven't taken the time to do so. The listings are layed out by category, and one of them is on 'text'. This category shows and talks about all the commands available to print text to the screen, manipulate strings, and the use of ASCII codes.

A few commands to extract characters from a string are:

1.)LEFT$()
2.)RIGHT$()
3.)MID$()

The first command will extract an amount of characters from left to right. For example, if you have a string with the text, Hello World!, then newchar$ = LEFT$("Hello World!",3) would fill newchar$ with the 'word' Hel. It extracted the first three characters from the left.

The second command is the same, except that the characters are extracted from the right. newchar$ = RIGHT$("Hello World!",3) would fill newchar$ with the 'word' ld!.

The last command here can be used to extract a single character at a time. It will extract, from left to right, a single character, given a value. For example, newchar$ = MID$("Hello World!",3) will fill newchar$ with the character l. It has extracted the third character from the string.

There are also many other commands that can be used to manipulate strings in amazing ways. One last, for example, is ASC(), which will return the ASCII number of the first character in a string. By the way, here is a small program you can use, which prints to the screen ASCII numbers, followed by their corresponding keyboard characters.



+NanoBrain+
Xlaydos
20
Years of Service
User Offline
Joined: 26th Mar 2004
Location:
Posted: 19th Apr 2005 06:07
@TKFISH Thanks Works great

@NanoBrain Cool that helps a lot in the game im making

Login to post a reply

Server time is: 2024-09-23 17:31:40
Your offset time is: 2024-09-23 17:31:40