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 acts the same as Text/Center Text

Author
Message
danctodd
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location:
Posted: 3rd Aug 2010 06:53 Edited at: 3rd Aug 2010 12:35
I've read this in a lot of tutorials that PRINT can not have the font changed. Yet if I use SET TEXT TO/FONT/SIZE and then run a print command, it will use the given font attributes. So was this another change made in DBPro more recently?


I've also noticed that you do not have to assign a variable any value if you use the AS keyword, but otherwise you must or you get an error.
Example:
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Aug 2010 02:16
Quote: "Yet if I use SET TEXT TO/FONT/SIZE and then run a print command, it will use the given font attributes."


Yeah it's been that way for a while now.

Quote: "I've also noticed that you do not have to assign a variable any value if you use the AS keyword, but otherwise you must or you get an error."


Generally we use AS STRING when we want to work with UDTs or when we don't want to use the $ symbol (which tells the compiler the variable is a string). Using the $ symbol then saying AS STRING is kinda redundant. B$ doesn't show anything because it doesn't have any value... if you make it B$="" then it'll add the carriage return so it'll show a blank line. D$ shows an error because it doesn't know what you want to do with it... do you want to define it something, or do you want to print it, or do you want to make it equal something else. Even Basic would freak out over that.



danctodd
14
Years of Service
User Offline
Joined: 31st Jul 2010
Location:
Posted: 4th Aug 2010 04:53
Ahh, so you generally just do:


unless you plan to do a UDT... What's the reason to change it when doing a UDT?

I figure it's easier to spot a string if it has the $ at the end than if I just did yourName as string because I can quickly scan it and see that symbol.
But in a book it said it was a bad idea and not as sufficient now since DBPro uses the AS keyword.

Login to post a reply

Server time is: 2024-11-23 11:32:54
Your offset time is: 2024-11-23 11:32:54