[GiDlist] If (strcmp) statement

Moderator: GiD Team

Post Reply
Farzam, Arash

[GiDlist] If (strcmp) statement

Post by Farzam, Arash »

Dear All,

I have written part of my .prb file (lines 10 and 11) as below:

QUESTION: Climate_Pattern_(NPATT):#CB#(Sinusoidal_Climate_Change,Constant_Climate_Change)
VALUE: Sinusoidal_Climate_Change

and I have an if statement in my .bas file as

*If(strcmp(Gendata(10),"Sinusoidal_Climate_Change")==0)
1 *\
*elseif(strcmp(Gendata(10),"Constant_Climate_Change")==0)
0 *\
*endif

But I don't get a value of 0 or 1 in the results file (whether I choose the first or second option).

Do you have an idea of what I am doing wrong?

Best Regards,
Arash Farzam
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] If (strcmp) statement

Post by escolano »

I have tested this (with GiD 10.1.6d win x32) and it worked well.

I think that probably the question Climate_Pattern_(NPATT):#CB#(Sinusoidal_Climate_Change,Constant_Climate_Change) is not the 10th question of your PROBLEM DATA block !!

note that questions are numbered from 1 to n, and is not the line number, is the question counter

to debug it you can also print the value of *Gendata(10)

GENDATA(10)=*Gendata(10)
*If(strcmp(Gendata(10),"Sinusoidal_Climate_Change")==0)
1 *\
*elseif(strcmp(Gendata(10),"Constant_Climate_Change")==0)
0 *\
*endif

To avoid index mistakes, and have a more easy to maintain (when adding/removing fields in future problemtype versions)
it is recommended to use the field name instead of the index

Gendata(1)=*GenData(Climate_Pattern_(NPATT))
*If(strcmp(Gendata(Climate_Pattern_(NPATT)),"Sinusoidal_Climate_Change")==0)
1 *\
*elseif(strcmp(Gendata(Climate_Pattern_(NPATT)),"Constant_Climate_Change")==0)
0 *\
*endif

Really the internal full name of the question is
"Climate_Pattern_(NPATT):#CB#(Sinusoidal_Climate_Change,Constant_Climate_Change) "
but to avoid so long and difficult names of this special fields is accepted the abbreviation removing from #CB# to the end

Enrique Escolano

----- Original Message -----
From: "Farzam, Arash" farzam at okstate.edu
To: GiDlist at listas.cimne.upc.edu
Sent: Tuesday, June 14, 2011 7:55 AM
Subject: [GiDlist] If (strcmp) statement


Dear All,

I have written part of my .prb file (lines 10 and 11) as below:

QUESTION: Climate_Pattern_(NPATT):#CB#(Sinusoidal_Climate_Change,Constant_Climate_Change)
VALUE: Sinusoidal_Climate_Change

and I have an if statement in my .bas file as

*If(strcmp(Gendata(10),"Sinusoidal_Climate_Change")==0)
1 *\
*elseif(strcmp(Gendata(10),"Constant_Climate_Change")==0)
0 *\
*endif

But I don't get a value of 0 or 1 in the results file (whether I choose the first or second option).

Do you have an idea of what I am doing wrong?

Best Regards,
Arash Farzam
_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110614/a506988c/attachment.htm
Jose Munoz

[GiDlist] Remote Desktop connection

Post by Jose Munoz »

Dear GID team,

When I access my Desktop via Remote Desktop application (in either
Windows or Mac), the GID program running on the remote computer crashes
(message says "runtime error").

I believe that when accessing via Remote Desktop the graphics mode (at
least the number of colours) is different from the mode I have when
directly visualising my GID program (not remotely). However, all other
programs that I am running on my remote machine manage to change the
mode. Is there anything I can do to avoid the crash of GID?

Many thanks,

Jose

Jose J Munoz, http://www-lacan.upc.es/munoz/
Laboratori de Càlcul Numèric (LaCàN)
Dep. Matemàtica Aplicada III
C/ Comte d'Urgell, 187, Room 1D010
Campus Urgell UPC, Edifici EUETIB
E-08036 Barcelona, Spain
j.munoz at upc.edu, Skype: josej.munoz, Tel. + 34 93 413 7253
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] Remote Desktop connection

Post by escolano »

We don't know what the 'Remote Desktop' exactly do. This is a program to
remotelly manage a Windows PC from a Mac, not?

Probably is some graphic problem as you pointed, try to start GiD without
any graphical acceleration
Go to Utilities-Preferences - Graphical, and select 'Safe visualization
mode' and press Accept (is is necessary restart GiD to apply it)

Note: off course redraws will be slower with this preference that use OpenGL
by software.

Regards

Enrique Escolano

----- Original Message -----
From: "Jose Munoz" j.munoz at upc.edu
To: gidlist at listas.cimne.upc.edu
Sent: Wednesday, July 13, 2011 2:24 PM
Subject: [GiDlist] Remote Desktop connection


Dear GID team,

When I access my Desktop via Remote Desktop application (in either
Windows or Mac), the GID program running on the remote computer crashes
(message says "runtime error").

I believe that when accessing via Remote Desktop the graphics mode (at
least the number of colours) is different from the mode I have when
directly visualising my GID program (not remotely). However, all other
programs that I am running on my remote machine manage to change the
mode. Is there anything I can do to avoid the crash of GID?

Many thanks,

Jose

Jose J Munoz, http://www-lacan.upc.es/munoz/
Laboratori de Càlcul Numèric (LaCàN)
Dep. Matemàtica Aplicada III
C/ Comte d'Urgell, 187, Room 1D010
Campus Urgell UPC, Edifici EUETIB
E-08036 Barcelona, Spain
j.munoz at upc.edu, Skype: josej.munoz, Tel. + 34 93 413 7253

_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
Jose Munoz

[GiDlist] Remote Desktop connection

Post by Jose Munoz »

Hi Enrique,

As far as I have tried, 'Remote Desktop' allows you to contact a PC from
a Mac or PC machine.

I have changed the visualisation mode, but I had no success. If you ever
find out the source of the problem, please let me know.

Many thanks,

Jose

On 7/13/2011 7:31 PM, Enrique Escolano wrote:
We don't know what the 'Remote Desktop' exactly do. This is a program to
remotelly manage a Windows PC from a Mac, not?

Probably is some graphic problem as you pointed, try to start GiD without
any graphical acceleration
Go to Utilities-Preferences - Graphical, and select 'Safe visualization
mode' and press Accept (is is necessary restart GiD to apply it)

Note: off course redraws will be slower with this preference that use OpenGL
by software.

Regards

Enrique Escolano

----- Original Message -----
From: "Jose Munoz"j.munoz at upc.edu
To:gidlist at listas.cimne.upc.edu
Sent: Wednesday, July 13, 2011 2:24 PM
Subject: [GiDlist] Remote Desktop connection


Dear GID team,

When I access my Desktop via Remote Desktop application (in either
Windows or Mac), the GID program running on the remote computer crashes
(message says "runtime error").

I believe that when accessing via Remote Desktop the graphics mode (at
least the number of colours) is different from the mode I have when
directly visualising my GID program (not remotely). However, all other
programs that I am running on my remote machine manage to change the
mode. Is there anything I can do to avoid the crash of GID?

Many thanks,

Jose

Jose J Munoz, http://www-lacan.upc.es/munoz/
Laboratori de Càlcul Numèric (LaCàN)
Dep. Matemàtica Aplicada III
C/ Comte d'Urgell, 187, Room 1D010
Campus Urgell UPC, Edifici EUETIB
E-08036 Barcelona, Spain
j.munoz at upc.edu, Skype: josej.munoz, Tel. + 34 93 413 7253

_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist

_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist

User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

[GiDlist] Remote Desktop connection

Post by escolano »

I am usually using the 'Remote Desktop Connection' standard tool of Windows
to open another Windows machine, and GiD works without any problem,
but I never user 'Remote Desktop' of Mac OS X to connect between Mac and
Windows.

----- Original Message -----
From: "Jose Munoz" j.munoz at upc.edu
To: gidlist at listas.cimne.upc.edu
Sent: Thursday, July 14, 2011 11:49 PM
Subject: Re: [GiDlist] Remote Desktop connection


Hi Enrique,

As far as I have tried, 'Remote Desktop' allows you to contact a PC from
a Mac or PC machine.

I have changed the visualisation mode, but I had no success. If you ever
find out the source of the problem, please let me know.

Many thanks,

Jose

On 7/13/2011 7:31 PM, Enrique Escolano wrote:
We don't know what the 'Remote Desktop' exactly do. This is a program to
remotelly manage a Windows PC from a Mac, not?

Probably is some graphic problem as you pointed, try to start GiD without
any graphical acceleration
Go to Utilities-Preferences - Graphical, and select 'Safe visualization
mode' and press Accept (is is necessary restart GiD to apply it)

Note: off course redraws will be slower with this preference that use
OpenGL
by software.

Regards

Enrique Escolano

----- Original Message -----
From: "Jose Munoz"j.munoz at upc.edu
To:gidlist at listas.cimne.upc.edu
Sent: Wednesday, July 13, 2011 2:24 PM
Subject: [GiDlist] Remote Desktop connection


Dear GID team,

When I access my Desktop via Remote Desktop application (in either
Windows or Mac), the GID program running on the remote computer crashes
(message says "runtime error").

I believe that when accessing via Remote Desktop the graphics mode (at
least the number of colours) is different from the mode I have when
directly visualising my GID program (not remotely). However, all other
programs that I am running on my remote machine manage to change the
mode. Is there anything I can do to avoid the crash of GID?

Many thanks,

Jose

Jose J Munoz, http://www-lacan.upc.es/munoz/
Laboratori de Càlcul Numèric (LaCàN)
Dep. Matemàtica Aplicada III
C/ Comte d'Urgell, 187, Room 1D010
Campus Urgell UPC, Edifici EUETIB
E-08036 Barcelona, Spain
j.munoz at upc.edu, Skype: josej.munoz, Tel. + 34 93 413 7253

_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist

_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist


_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
Post Reply