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 / Input based image or data

Author
Message
Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 14th Mar 2010 21:52
i am making a program where a user enters a series of letters aka TTGGCAA or something like that.

After s/he enters the letters, the program continues.\

the thiung is for each letter the user enters, there is a specific image the program should load.

how do i make the program distinguish each letter?

Also, each image put together is a new image - how do i name each new image. Do i use an array?

Thanks

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 14th Mar 2010 21:59
I'm not sure exactly what you mean... but If its something like what i think it is, could you do this:

Create an array for each letter



And cross reference each letter to the path of the image



Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 14th Mar 2010 22:51
i get extremely confused by arrays, even though I have been programming for 3 years

could you go into some more detail?

thanks for the help btw

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 14th Mar 2010 23:27
If you get confused by arrays, you should try and find a tutorial on them, they're pretty simple.

For example, you list all your possible images, and link them to the letter.



Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 14th Mar 2010 23:40 Edited at: 14th Mar 2010 23:40
here is a function to find the indexnumber of a letter:



97 is the ascii code for "a" (lower case) so the ascii code of the letter in lower case - 96 will mean that the leter "a" returns 1, "b" returns 2........

plug this into the first slot i ur array and u will good to go!!

Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 15th Mar 2010 00:17
thanks a lot That1SmartGuy.

MAdNightmare, I have followed you advice for 2 years!

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 15th Mar 2010 00:26
Quote: "MAdNightmare, I have followed you advice for 2 years! "


What? I don't think I've given you advice before... Are you unhappy with the advice I've given you or was I not specific enough?

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 15th Mar 2010 00:37
Nothing like that.

I just meant I have been trying to learn arrays from tutorials for 2 years.

Indicium
18
Years of Service
User Offline
Joined: 26th May 2008
Location:
Posted: 15th Mar 2010 00:59
Oh right! lol, i misinterpreted what you said.

Windows 7 32-Bit Home Premium Intel Pentium Dual-Core @ 1.46Ghz 2038mb RAM
Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 15th Mar 2010 04:47
haha

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Mar 2010 18:12
Have you tried tutorial 1 here:

http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10

I only mention it because it's tucked away hidden on the DB Classic board and most DBPro users rarely venture in there, so they easily get missed.

Don't worry, most of them are at such a low level they apply equally to DB Classic and Pro.

TDK

Jedi Padawan
17
Years of Service
User Offline
Joined: 17th Jun 2009
Location: None of your business
Posted: 16th Mar 2010 04:48
thanks

NickH
18
Years of Service
User Offline
Joined: 19th May 2008
Location: Nova Prospekt, North Yorks, UK
Posted: 19th Mar 2010 15:23
You could pickout specific characters from the string. I've done something similar...ish in the past using IanM's Matrix plugin which has a set of good commands for doing such things. Not sure this 100% applies to what you want....just an idea.
Hawkblood
16
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 19th Mar 2010 19:37
@Jedi Padawan
What is it about arrays you don't understand?

The fastest code is the code never written.

Login to post a reply

Server time is: 2026-07-26 21:12:08
Your offset time is: 2026-07-26 21:12:08