Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Programming F6 (Read 2016 times)
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Programming F6
Reply #15 - Jan 11th, 2006 at 1:22pm
Print Post Print Post  
Quote:
Mark -


I'm Erika. Smiley

Quote:
Still being a novice at Sbasic, I am a little confused about the sub-routine being in global code.  I can understand it being there if I am going to use it in a number of elements.  If, however, I planned to use it in one specific layout element, only, could I put the sub-routine, along with the other programming, in the on-element-entry event?


You could. I usually put routines that may be generally useful in GLOBAL CODE so I only have to look for them in one place. However, it will work from the same event where called.

Quote:
With regard to:

Code
Select All
vHeight = (@Int(vLen / 25) + 1) * 20
 



It appears to me that you are looking at the length of what is in the field (# of characters)  (for example 200) dividing that by 25 (which would become 8), adding 1 (which would become 9) and then multiplying the product by 20 (which would become 180).  Is this some magic formula for converting characters to pixels? 

And, wouldn't the "formula" somehow be greatly affected by the width of the element as well as the number of charcters in the field?


Yes. It's not a magic number. You are interpreting the code correctly. It's just the numbers that worked for the element width and font size I was using. As both Height and Font Size are measured in pixels, no conversion is needed. Just a simple division to determine how many "lines" there are in my case at 25 characters per line) multiplied by a number a bit larger than the font size. The "+1" just creates an extra line of padding.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Programming F6
Reply #16 - Jan 11th, 2006 at 4:40pm
Print Post Print Post  
Erika -

Quote:
I'm Erika.


I don't understand your comment; that's what I said ... Erika.

Anyhow, thanks much for the dialogue.  It is much clearer now and, thus, will be more helpful.

And OK I cannot tell a lie (Well, actually I can, but I won't).  I went back and modified the message to read Erika (instead of Mark), just to be "playful."
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print