Style Definition / Height Request Order

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-08-17 08:48 AM
2006-08-17
08:48 AM
The first example image uses the following script to define and set the style and get its height. The appearance is correct:
SET STYLE fjmt_txt_style
xx=REQUEST ('Height_of_style', fjmt_txt_style, fjmt_fjmt_txt_style_ht)
The second uses:
xx=REQUEST ('Height_of_style', fjmt_txt_style, fjmt_fjmt_txt_style_ht)
SET STYLE fjmt_txt_style
The only difference in the entire script is the order of the SET STYLE and REQUEST lines are switched. Having the the REQUEST before the SET STYLE obviously breaks the latter and AC just uses the default style ... but why? I can't find this documented anywhere and no luck with posts here.
I've run into this on and off for a while but never really looked into it as it can be worked around easily enough. I'm just interested to know

(btw the text is just feedback on ASSOCLP_PARVALUEs while im working on the script to position the label relative to the leaf & frame)
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-08-17 09:48 AM
2006-08-17
09:48 AM
You use the name fjmt_txt_style twice: First as variable/ parameter name, second as name for a text style.
Names of text styles are raw string-names or an index which do have an internal pointer to the content, the definition parameters. You can substitute them in commands by string or numerical varaibales, whichcontain the name or index. If you use
SET STYLE fjmt_txt_style
AC tries to find a variable of this name. If it is not found, it takes the name itself as string and tries to find the text style of this name. If it is found and it is a numeric value, it points to the define style block.
In your first example. No variable is defined, AC takes 'fjmt_txt_style' as name.
In the second example fjmt_txt_style is declared out of the REQUEST before and has a numeric value with obvisious not defined value of an index pointer. It contains any height value. So AC uses STYLE 0, which means standard style: Arial, height 5mm.
You should use it like this:
SET STYLE 'fjmt_txt_style'
Does this make sense for you?
Names of text styles are raw string-names or an index which do have an internal pointer to the content, the definition parameters. You can substitute them in commands by string or numerical varaibales, which
SET STYLE fjmt_txt_style
AC tries to find a variable of this name. If it is not found, it takes the name itself as string and tries to find the text style of this name. If it is found and it is a numeric value, it points to the define style block.
In your first example. No variable is defined, AC takes 'fjmt_txt_style' as name.
In the second example fjmt_txt_style is declared out of the REQUEST before and has a numeric value with obvisious not defined value of an index pointer. It contains any height value. So AC uses STYLE 0, which means standard style: Arial, height 5mm.
You should use it like this:
SET STYLE 'fjmt_txt_style'
Does this make sense for you?
bim author since 1994 | bim manager since 2018 | author of selfGDL.de | openGDL | skewed archicad user hall of fame | author of bim-all-doors.gsm

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2006-08-18 01:56 AM
2006-08-18
01:56 AM