2005-05-20 02:36 AM
2005-05-20 10:40 AM
Joseph wrote:In the first problem line, you are trying to add two values which are not the same kind. 'olftext' is a string (textual) value, and 'ol_factor' is an integer (numeric) value. The + operator in GDL is designed to only add things of the same kind, e.g. '1 + 1 = 2' or '"ABC" + "DEF" = "ABCDEF"'. The problem line says something like '1 + "ABC" = ???'
In 2D script I am getting some sort of mismatch errors in two places...
...
ol_factor = olftext + ol_factor < HAVING PROBLEM WITH THIS LINE
...
w_olf = (stw (ol_factor)+2) * olf < HAVING PROBLEM WITH THIS LINE
ol_factor = olftext + STR(ol_factor, 8, 0)Read the documentation on STR to determine how you can best use it. The script now works with this change, but I would recommend another related change. The variable called 'ol_factor' is a parameter with an integer value. In your script you subsequently assign a string value to it. Although this works, I recommend not changing a variable's type. Create a new variable instead:
olFactorText = olftext + STR(ol_factor, 8, 0) ... w_olf = (STW(olFactorText) + 2) * olf ... TEXT2 dist, -vlen, olFactorText
2005-05-20 08:24 PM
Ralph wrote:Thanks a million Jay,
In the first problem line, you are trying to add two values which are not the same kind. 'olftext' is a string (textual) value, and 'ol_factor' is an integer (numeric) value. The + operator in GDL is designed to only add things of the same kind, e.g. '1 + 1 = 2' or '"ABC" + "DEF" = "ABCDEF"'. The problem line says something like '1 + "ABC" = ???'
2005-05-20 11:35 PM
Joseph wrote:The STW function returns the (display) length of a string, i.e. it's size when it is displayed in a drawing. Therefore, STW(olFactorText) will give you the length of the string in the variable olFactorText.
1. Based on what you say, In expression "w_olf = (STW(olFactorText) + 2) * olf" what is the reason for multiplying by "olf" parameter? Is it that if this parameter olf, is 1 if set to ON and 0 if set to OFF so we want to make the value of "w_olf " to zero when olf is set to OFF so will not have effect on other parts of the script?
Futher more, If so 1 or 0 are INTEGERS and olFactorText is TEXT?
Joseph wrote:No, all the variables in that line are text. The author of the script has assigned text values to variables that were originally numbers:
2. Also based on what you say, the previous line of the code on ROOM_PERIM = PERITEXT + ROOM_PERIM + LIN_UNIT should not wok either since: ROOM_PERIM is lengthand I assume a REAL number and PERITEXT is text!?
room_perim = str (lin_form , ROOM_PERIM)The confusion you are feeling is the reason for my suggestion to use different names rather than changing the type of an existing variable.
2005-05-20 11:42 PM
Ralph wrote:Thanks and have a GREAT week end, after your guidance I will have a great one also.
The confusion you are feeling is the reason for my suggestion to use different names rather than changing the type of an existing variable.
2005-05-26 09:06 PM
Ralph wrote:Ralph,
No, all the variables in that line are text. The author of the script has assigned text values to variables that were originally numbers
2005-06-02 10:21 AM
Joseph wrote:Yes, it is converted on the following line:
I tried to get the integer (INT) portion of the parameter room_area so I can have the area with out the decimals (for better representation in the stamp), but I am getting an error.
I guess it is because it is converted to text somehow.
room_area = str (area_form, Temp_CalcArea)It would be better to use a different variable name for the text version so you can retain the original value (and the two can't be confused with each other), e.g.
roomAreaText = str (area_form, Temp_CalcArea)The author of this object has used lower case for the text variable, so you could quickly change every instance with "Find & Replace..." provided you check the 'Case Sensitive' option.
2005-06-02 11:06 PM
Ralph wrote:Welcome Back and here I go again,
The author of this object has used lower case for the text variable, so you could quickly change every instance with "Find & Replace..." provided you check the 'Case Sensitive' option.