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 / SET CURSOR Function

Author
Message
Ant
19
Years of Service
User Offline
Joined: 27th Nov 2004
Location:
Posted: 17th Apr 2006 22:23
Hello all !

I am just beginning to learn about functions, and have tried to come up with a function, that would emulate the SET CURSOR command.
It is completely wrong, so maybe you could check it out, and give me some pointers.

My version does not use the correct integer values for the co-ordinates, also could anyone give me an example of the TEXT command as a function.

Thanks.

The end is near
19
Years of Service
User Offline
Joined: 19th Jun 2005
Location: USA
Posted: 18th Apr 2006 05:20 Edited at: 18th Apr 2006 05:20
im all for you trying to figure this stuff out. it's learning!
but i would make a function that does what a command alone cannot.
thats why they have functions.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Apr 2006 06:30
Like digital dude suggests, your choice of command to emulate is not a good one.

You can't write a Set Cursor function with native DB commands as the DB command itself calls a system function to position the cursor without altering the current screen contents.

Using your 'Print' method, even if it did work, it would just overwrite whatever was already on the screen anyway.

You would have to call a DLL yourself to do it, but the whole excercise is pointless in this case.

TDK_Man

Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 18th Apr 2006 14:22
Sometimes it can wide your understanding for a command to "emulate" it. But still, digital dude has a point.
Ant
19
Years of Service
User Offline
Joined: 27th Nov 2004
Location:
Posted: 19th Apr 2006 21:00
Hi guys

Thanks for your thoughts on this, I guess your right, I just wanted to try and delve a little deeper, when I should be concentrating on trying to learn all the commands that already exist.

It's just I read somewhere, that the TEXT command was really only a SET CURSOR and PRINT fuction. I played around with it and came up with the following, just in case anyone may come across this thread in a search.

Thanks for all your advice !

Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 19th Apr 2006 21:31
Thats what I meant with that it can help to understand a command by "emulating" it . Goodluck with your programming.

Login to post a reply

Server time is: 2024-09-24 21:30:43
Your offset time is: 2024-09-24 21:30:43