need help (dates and lines - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QBasic (http://qbasicnews.com/newforum/forum-4.html) +--- Forum: QB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-11.html) +--- Thread: need help (dates and lines (/thread-9088.html) Pages:
1
2
|
need help (dates and lines - staz - 03-29-2006 hi i am writting a program and would like the date to be displayed in the form for example i want 03/21/2006 to read 21st march 2006 another problem i am having is that when i try put in a line it say illegal function call can anyone tell me what this means? can any one help me at all need help (dates and lines - Agamemnus - 03-29-2006 For the first question, you must know about STR$() and SELECT CASE.. you should get each of the different elements "3", "21", "2006" into different variables, i.e. month1%, day1%, year1%. Then you use SELECT CASE to add in the appropriate string pieces to make a different string, e.g.: Code: SELECT CASE day1% Can you put up the code that you got with "illegal function call"? That just means you didn't type it as it should be.. need help (dates and lines - axipher - 03-29-2006 Here ya go, it's of use to me so I don't mind posting it: Code: ' Date converter Quote:Example Output It works fine in QBasic 4.5 and also in FreeBasic. need help (dates and lines - Agamemnus - 03-30-2006 I'll supply a "Thank you" to you, axipher. need help (dates and lines - Anonymous - 03-30-2006 so does staz's teacher need help (dates and lines - Agamemnus - 03-30-2006 Aha, yes. That's right. Double standards. Ahem. *clears throat* Bad, bad axipher! It should not have been a 100% working program. need help (dates and lines - axipher - 03-30-2006 Sorry, but I would have posted it any way, once I see a problem, I take a crack at it, if I get it I show the forum that I have changed from a useless spam posting know-it-all jerk to someone who submits answers to problems. He would have got it either way, and I'm sorry I posted the working code, I could have posted the original FB code which has Code: dim as string Code: dim months(1 to 12) as string * 9 => {[list here]} need help (dates and lines - Agamemnus - 03-30-2006 Yeah that's ok... he probably won't even read this again, anyway. need help (dates and lines - na_th_an - 03-31-2006 The thingo is that someone registers and its only post is asking for some homework to be done, and you do it for him, it's wrong. Imagine that some guy is asked to solve 10 equations at school and his dad does them for him, instead of explaining him how to solve equations. Same thing. Btw, the cardinal to ordinal conversion can be done in quite fewer lines: Code: Function card2ord (number As Integer) As String And it works for every number. need help (dates and lines - axipher - 03-31-2006 not really, think of 11 to 19, they all have "th" at the end and 111 to 119 and 211 to 219... |