Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.
2006-01-13 05:27 PM
2006-01-16 05:03 PM
F. wrote:It's more than raw -- it's ugly, but the only other way I had done capitalization was comparing ascii values. Thanks for showing me the clean way to do it.1000: IF NameChar = "a" THEN SubChar = "A" IF NameChar = "b" THEN SubChar = "B" IF NameChar = "c" THEN SubChar = "C" ...is a bit raw.😉
IF GLOB_MODPAR_NAME = `pCapitalize` THEN NewName = "" LowerChars = "abcdefghijklmnopqrstufwxyz" UpperChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" FOR Idx = 1 TO STRLEN(ROOM_NAME) NameChar = STRSUB(ROOM_NAME, Idx, 1) CharPos = STRSTR(LowerChars, NameChar) IF CharPos THEN NewName = NewName + STRSUB(UpperChars, CharPos, 1) ELSE NewName = NewName + NameChar ENDIF NEXT Idx pCapitalize = 0 ROOM_NAME = NewName PARAMETERS pCapitalize = pCapitalize, ROOM_NAME = ROOM_NAME ENDIFThanks again!!
2006-01-16 08:12 PM
2006-01-16 09:55 PM
F. wrote:Understood -- but crazy. What possible value could there be in PARAMETERS ROOM_NAME = NewName not actually changing the value of ROOM_NAME?
Understandable?
2006-01-16 11:03 PM
Jay wrote:I know what Frank is getting at.F. wrote:Understood -- but crazy. What possible value could there be in PARAMETERS ROOM_NAME = NewName not actually changing the value of ROOM_NAME?
Understandable?That's not an intiutive idea at all. When would I ever use a line of code like that
expectingthat nothing will change?
PARAMETERS ROOM_NAME = NewName PARAMETERS ROOM_NAME = NAMEis akin to saying:
ROOM_NAME = 1 ROOM_NAME = 2At no time are you setting the script parameter ROOM_NAME to be NewName.
PARAMETERS ROOM_NAME = NewNamesets the Parameter List variable "Room Name" to be equal to NewName, not the ROOM_NAME variable inside the script.
PARAMETERS ROOM_NAME = ROOM_NAMEoverwrites the previous line, setting the Parameter List variable ROOM_NAME back to itself, since the ROOM_NAME variable in the script has not been changed.
2006-01-17 12:00 AM
TomWaltz wrote:If I have this correct, to make it simple we can say that the only time you should reference any of the parameters in the script is if you are getting a value (MyRoomName = ROOM_NAME), or if you are saving a value into the parameter (PARAMETERS ROOM_NAME = MyNewName). In all other circumstances, you should use variables to perform the manipulations because a statement like ROOM_NAME = MyNewName + "CLASSROOM" is creating a new
The linePARAMETERS ROOM_NAME = NewNamesets the Parameter List variable "Room Name" to be equal to NewName, not the ROOM_NAME variable inside the script.
2006-01-17 01:16 AM