String Arrays
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-03-31 03:12 AM
2007-03-31
03:12 AM
I wanted to create an array that a user could use to input some 3 character variables.
If I dimension the variable (I.e., DIM wlunit [10][10] or even DIM wlunit [][] in the Master Script, the user cannot enter any values. In the past, I was able to initialize the array in the Master script and then the user would be allowed to change the values. Now I cannot initialize the array or dimension it.
A part created in AC9 (or was it AC8 that was then saved in AC9) with an array. It has an initialized array and I can change the parameters later in the object setting dialog box.
Is there a correct way to do it? It would be nice to be able to initialize my array.
16 REPLIES 16
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-03-31 10:32 PM
2007-03-31
10:32 PM
Phil,
I just read your last post.
I think I now know what your getting at.
You want to have some sort of "re-set" function.
We will have to think about that one.
Peter Devlin
I just read your last post.
I think I now know what your getting at.
You want to have some sort of "re-set" function.
We will have to think about that one.
Peter Devlin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-01 06:44 AM
2007-04-01
06:44 AM
Phil,
I think that a bigger picture of what you are trying to achieve with your object will help us understand your problem better.
I think that a bigger picture of what you are trying to achieve with your object will help us understand your problem better.
Howard Phua
Win 10, Archicad 19 INT
Win 10, Archicad 19 INT
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-03 12:26 AM
2007-04-03
12:26 AM
pfeinberg wrote:If all you want to do is reset the values to defaults after editing, just run the FOR/NEXT loop and then comment the code before saving. You can also use this to create initial non-zero values. In fact, I find this easier than entering the values manually in the parameters list (seriously bad interface IMHO).
I agree that the array gets created as nulls but in the process of testing my part, values get put into the array. I was hoping I could use a FOR/NEXT loop to empty them out but still have the user input their values later.
As I said it worked in previous versions of AC and doesn't now so I just want to know if there is a way to do it properly.
Phil
The user can always reset all the parameters to defaults by switching to another part and back, so all the IF/THEN and GLOB_MODPAR_NAME tricks are only needed for a partial reset or to reinitialize for changed conditions.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-03 05:49 AM
2007-04-03
05:49 AM
Reset is very easy to implement.
create a parameter says "reset_all".
!-----------------script--------------------
IF reset_all THEN
FOR i=1 TO VARDIM1(array)
FOR j=1 TO VARDIM2(array)
PARAMETERS array="Whatever Values"
NEXT i
NEXT j
PARAMETERS reset_all=0
ENDIF
!------------------------------------------
Hope this help!
create a parameter says "reset_all".
!-----------------script--------------------
IF reset_all THEN
FOR i=1 TO VARDIM1(array)
FOR j=1 TO VARDIM2(array)
PARAMETERS array
NEXT i
NEXT j
PARAMETERS reset_all=0
ENDIF
!------------------------------------------
Hope this help!
Howard Phua
Win 10, Archicad 19 INT
Win 10, Archicad 19 INT
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-10 10:42 AM
2007-04-10
10:42 AM
If you want to create an initiallization part do the following.
Create a variable named for example trigger.
In the master script have a simple code line such as (not gdl code but metacode)
If (trigger = true ) then trigger=false
Else trigger=true
That way you trigger the GLOB_MODPAR_NAME to be set to trigger
then using the GLOB_MODPAR_NAME in the parameters section you can create a code to handle when the trigger parameter changes. Put there all the initialisation code. Simple as that.
Create a variable named for example trigger.
In the master script have a simple code line such as (not gdl code but metacode)
If (trigger = true ) then trigger=false
Else trigger=true
That way you trigger the GLOB_MODPAR_NAME to be set to trigger
then using the GLOB_MODPAR_NAME in the parameters section you can create a code to handle when the trigger parameter changes. Put there all the initialisation code. Simple as that.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-10 04:20 PM
2007-04-10
04:20 PM
oreopoulos wrote:This sounds like the liar's paradox (from ancient Greece as I recall)
If (trigger = true ) then trigger=false
Else trigger=true

Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2007-04-10 06:58 PM
2007-04-10
06:58 PM
Not exacly 
This is executed once and just changes the state of the boolean variable.
The paradox you talk goes like this: (the zinon paradox)
I am a man and i always tell the truth and i say i am lying.
This is a paradox caused by selfreferenced sentenced. Such logical sentences are not valid in mathematical first order logic.
But ofcourse the code above has nothing to do with that

This is executed once and just changes the state of the boolean variable.
The paradox you talk goes like this: (the zinon paradox)
I am a man and i always tell the truth and i say i am lying.
This is a paradox caused by selfreferenced sentenced. Such logical sentences are not valid in mathematical first order logic.
But ofcourse the code above has nothing to do with that
- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »