hello ive been checking forums and searching for tutorials that are suposed to be for beginners to programming but so far all that ive found are vague and very non- descriptive "Hello World" tutorials and examples of code that are very briefly described and im just not getting it yet!!! Btw im talking about freebasic. ive read a couple and i completely understand the whole { Print "whatever goes here" } {sleep} (the brackets are seperate lines) concept (woo-hoo!!!) and the basic dim varible concept. i have written a small calculator program based on the examples in the FB manual (actually its 4 seperate programs, each named after their function; ie: add.exe, divide.exe…… so all you have to do is type the function at the command prompt; ie: c:/>add [enter], or c:/>multiply [enter])very basic. ok so i got it…… not quite!!!
there is another example further down the tutorial (FB manual programming reference/pro……../freeBasic primer) that converts pounds to kgs ok so i figure as good practice and to help understand i figured i'de try to make my own conversion program to convert to or from any of the following lbs,oz,grams. thats where im stuck!!!! i cant figure out how to go about letting the user make a decision. and then setting the varible and value based on that decision!!!! also if there is a way to let the input from the user be set as a string; ie:covert from: lbs(for pounds)or oz and so on! (WHEW!!!) if anybody could help me i would really appreciate it!! something like a partial example code and an explanation of how it works (something along the lines of: "give a man a fish and feed him for a day. teach a man to fish and feed him for a lifetime) also i apologize for my horrible grammar in this thread!! thanx ahead of time for any help you my be able to give me!
if condition then
' do this
elseif condition then
'do this
else condition then
' do this
end if
condition is things like var = 6 or answer = "yes".
I'll explain this more after I wake up. —hartnell
In the meantime, the FBHacker tutorials and our text game source code may interest you. —hartnell
wow that was quick response time!!! between the game tutorials and and the fb manual i think i might have figured out a way using {select case as const choice} where choice has been dim as integer in my first input request. but im still experimenting and really want to learn the "best way" per se and i cant ask tutorials questions so i chose this forum! im not sure how much advice is too much to ask for (or other forum etiquette for that matter) but here we go:
if i use the answer = "yes" will that let the user use text varible to identify decisions? ie:{covert from:}(user command) lbs(for pounds)or oz…..(user input) because i have the varible set as integer (choice) from the info i picked up on one of the game tutorials on this simple but EXTREMELY helpful website but ide like for the user to be able to input lbs or gr instead of "choose 1 for pounds"!!! also would it help if i pasted my code here to show you what ive got and if im heading in the right direction. i understand you are probably very busy and have better things to do than to look over "some noobs" code. so i appreciate any help more than you know!!! if theres anyway i can help just let me know!! also this program is only for my own personal learning exercise, the calc program was my first and now this just to help understand more of the whole concept!!! its not like its my lifes work or anything so take your time and help if and when you or anyone else can!! with that said, thanx again
About forum etiquette : GDN is here for noobs. GDN gets better because noobs ask questions. Ask away :)
Here's an example :
dim strAnswer as string
dim intNumber as integer
print "Choose your conversion."
print
print "pounds"
print "ounces"
print
input " > ", strAnswer
if strAnswer = "pounds" then
print "How many pounds?"
input " > ",intNumber
' conversion here
elseif strAnswer = "ounces" then
print "How many ounces?"
input " > ",intNumber
'conversion here
end if
aha that must be what my calculating problem is!!! i have a completed work but the calculations are wrong!!! im gonna apply tose and ill let u know how it came out!!! thanx again for all your help