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 / Print Problems

Author
Message
Tyler
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 28th Jan 2004 18:36
A little problem i have, when I run this, the name$ (Guest) doesn't show up, Why??



is a bum livin off the grace of society...
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 28th Jan 2004 19:08
You need the variable to be a GLobal variable to be read inside of a function e.g.



or you could pass the name$ in as a parameter e.g.



Hope this helps,

Jas
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 28th Jan 2004 21:27 Edited at: 28th Jan 2004 21:28
jasuk70, I think you gave him the correct code but I think he needs explanation. the reason why the name does not show up is because it was declared outside of the function. A function sort of resets all variables and uses it's own, to make the function not doing this you have to use the GLOBAL command in the beginning of your code. what does the global command do? well it makes sure the variable you specified is used everywhere, so also in the functions. hope I helped



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
Tyler
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 29th Jan 2004 05:07 Edited at: 29th Jan 2004 05:50
(edited)
Ok, if you saw this post before, I spoke too soon, It wouldn't let me use the GLOBAL command?.?.?

is a bum livin off the grace of society...
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 29th Jan 2004 12:43
What error message did you get?

Jas
Tyler
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 29th Jan 2004 17:52
"Syntax Error: Command not found"

is a bum livin off the grace of society...
Mussi
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location: Netherlands
Posted: 29th Jan 2004 19:39
I guess you're using DB classic, dunno how it works in classic but it should be the same



Specs: AMD Athlon 1800, 256 DDRRam 266mhz, 80GB HD 7200rmp U133, Geforce 4 Ti4400 128mb
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 29th Jan 2004 22:19
CLS : L=1 : name$="Guest"
uline$(name$)
END

`****************************FUNCTIONS*************************
FUNCTION uline$(string$)
DO
CLS
IF L=1
`PRINT string$
INPUT string$+"$ ", command$
ELSE
INPUT string$+"$ ", command$
ENDIF
LOOP
ENDFUNCTION

You can do it if you try
Tyler
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 30th Jan 2004 22:35
I tried that something like that but it still didn't work, and yes i am using classic..

is a bum livin off the grace of society...
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 30th Jan 2004 22:58
The L is also trying to be used in the Function. Did you try passing the L through as well?

FUNCTION uline$(string$,L)

I've not used Classic so this is a shot in the dark.

Jas
Tyler
20
Years of Service
User Offline
Joined: 10th Jan 2004
Location:
Posted: 4th Feb 2004 18:02
yup, it still doesn't work though...

is a bum livin off the grace of society...
http://www.geocities.com/tylerc1324

Login to post a reply

Server time is: 2024-11-26 03:55:33
Your offset time is: 2024-11-26 03:55:33