() |
#
# Purpose : This file provides an example of a call to the
# function pref_geo_get_v1()
#
# This illustration opens a new database and gets
# the geometry preference of the current database
# Then it changes the geometry preferences and
# gets it again.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_geo_get_v1()
# has the following arguments:
#
# pref_geo_get_v1
# ( default_coord_frame,
# geometric_tolerance,
# working_plane )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_default_coord_frame
REAL r_geometric_tolerance
INTEGER i_working_plane
INTEGER i_return_value
STRING sv_asm_create_cord_3po_creat_id[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the geometry preference settings.
i_return_value = @
pref_geo_get_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
dump i_working_plane
#---------------------------------------------------------------------
# Create a Coordinate frame
i_return_value = @
asm_const_coord_3point( "1", "Coord 0", @
1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @
sv_asm_create_cord_3po_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Set a different Geometry preference
i_default_coord_frame = 1
r_geometric_tolerance = 0.005
i_working_plane = 1
i_return_value = @
pref_geo_set_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane)
dump i_return_value
#---------------------------------------------------------------------
# Get the geometry preference settings.
i_return_value = @
pref_geo_get_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
dump i_working_plane
sys_free_string(sv_asm_create_cord_3po_creat_id)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_geo_set()
#
# This illustration opens a new database and gets
# the geometry preference of the current database
# Then it changes the geometry preferences and
# gets it again.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_geo_set() has the following arguments:
#
# pref_geo_set
# ( default_coord_frame,
# geometric_tolerance )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_default_coord_frame
REAL r_geometric_tolerance
INTEGER i_return_value
STRING sv_asm_create_cord_3po_creat_id[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the geometry preference settings.
i_return_value = @
pref_geo_get @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
#---------------------------------------------------------------------
# Create a Coordinate frame
i_return_value = @
asm_const_coord_3point( "1", "Coord 0", @
1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @
sv_asm_create_cord_3po_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Set a different Geometry preference
i_default_coord_frame = 1
r_geometric_tolerance = 0.005
i_return_value = @
pref_geo_set @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
#---------------------------------------------------------------------
# Get the geometry preference settings.
i_return_value = @
pref_geo_get @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
sys_free_string(sv_asm_create_cord_3po_creat_id)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_geo_set()
#
# This illustration opens a new database and gets
# the geometry preference of the current database
# Then it changes the geometry preferences and
# gets it again.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_geo_set() has the following arguments:
#
# pref_geo_set
# ( default_coord_frame,
# geometric_tolerance )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_default_coord_frame
REAL r_geometric_tolerance
INTEGER i_return_value
STRING sv_asm_create_cord_3po_creat_id[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the geometry preference settings.
i_return_value = @
pref_geo_get @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
#---------------------------------------------------------------------
# Create a Coordinate frame
i_return_value = @
asm_const_coord_3point( "1", "Coord 0", @
1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @
sv_asm_create_cord_3po_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Set a different Geometry preference
i_default_coord_frame = 1
r_geometric_tolerance = 0.005
i_return_value = @
pref_geo_set @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
#---------------------------------------------------------------------
# Get the geometry preference settings.
i_return_value = @
pref_geo_get @
( i_default_coord_frame, @
r_geometric_tolerance )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
sys_free_string(sv_asm_create_cord_3po_creat_id)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_geo_set_v1()
#
# This illustration opens a new database and gets
# the geometry preference of the current database
# Then it changes the geometry preferences and
# gets it again.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_geo_set_v1() has the following arguments:
#
# pref_geo_set_v1
# ( default_coord_frame,
# geometric_tolerance,
# working_plane )
#
#---------------------------------------------------------------------
# Variable Declarations
INTEGER i_default_coord_frame
REAL r_geometric_tolerance
INTEGER i_working_plane
INTEGER i_return_value
STRING sv_asm_create_cord_3po_creat_id[VIRTUAL]
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the geometry preference settings.
i_return_value = @
pref_geo_get_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
dump i_working_plane
#---------------------------------------------------------------------
# Create a Coordinate frame
i_return_value = @
asm_const_coord_3point( "1", "Coord 0", @
1, "[0 0 0]", "[0 0 1]", "[1 0 0]", @
sv_asm_create_cord_3po_creat_id )
dump i_return_value
#---------------------------------------------------------------------
# Set a different Geometry preference
i_default_coord_frame = 1
r_geometric_tolerance = 0.005
i_working_plane = 1
i_return_value = @
pref_geo_set_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane)
dump i_return_value
#---------------------------------------------------------------------
# Get the geometry preference settings.
i_return_value = @
pref_geo_get_v1 @
( i_default_coord_frame, @
r_geometric_tolerance, @
i_working_plane )
dump i_return_value
# Geometry preference settings are
dump i_default_coord_frame
dump r_geometric_tolerance
dump i_working_plane
sys_free_string(sv_asm_create_cord_3po_creat_id)
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_global_get()
#
# This illustration opens a new database and gets
# the global preference of the current database.
# Then it changes the global preferences and
# gets it again. Finally it changes the global
# preference settings into the original value.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_global_get()
# has the following arguments:
#
# pref_global_get
# ( confirm,
# warning_message,
# global_tolerance )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_confirm
INTEGER i_warning_message
REAL r_global_tolerance,r_old_tolerance
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the global preference settings.
i_return_value = @
pref_global_get @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
# Global preference settings are
dump l_confirm, i_warning_message, r_global_tolerance
#---------------------------------------------------------------------
# Set new Global preference settings.
IF (l_confirm == TRUE) THEN
l_confirm = FALSE
ELSE
l_confirm = TRUE
END IF
IF ( i_warning_message == 3 ) THEN
i_warning_message = 2
ELSE
i_warning_message = 3
END IF
r_old_tolerance = r_global_tolerance
r_global_tolerance = 0.009
i_return_value = @
pref_global_set @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
#---------------------------------------------------------------------
# Get the global preference settings.
i_return_value = @
pref_global_get @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
# Global preference settings are
dump l_confirm, i_warning_message, r_global_tolerance
#---------------------------------------------------------------------
# Set the original values of Global preference settings.
IF (l_confirm == TRUE) THEN
l_confirm = FALSE
ELSE
l_confirm = TRUE
END IF
IF ( i_warning_message == 3 ) THEN
i_warning_message = 2
ELSE
i_warning_message = 3
END IF
r_global_tolerance = r_old_tolerance
i_return_value = @
pref_global_set @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_global_set()
#
# This illustration opens a new database and gets
# the global preference of the current database.
# Then it changes the global preferences and
# gets it again. Finally it changes the global
# preference settings into the original value.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_global_set() has the following arguments:
#
# pref_global_set
# ( confirm,
# warning_message,
# global_tolerance )
#
#---------------------------------------------------------------------
# Variable Declarations
LOGICAL l_confirm
INTEGER i_warning_message
REAL r_global_tolerance, r_old_tolerance
INTEGER i_return_value
#---------------------------------------------------------------------
# Open a new database
uil_file_new.go( "", "./new.db" )
$? YES 36000002
# Get the global preference settings.
i_return_value = @
pref_global_get @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
# Global preference settings are
dump l_confirm, i_warning_message, r_global_tolerance
#---------------------------------------------------------------------
# Set new Global preference settings.
IF (l_confirm == TRUE) THEN
l_confirm = FALSE
ELSE
l_confirm = TRUE
END IF
IF ( i_warning_message == 3 ) THEN
i_warning_message = 2
ELSE
i_warning_message = 3
END IF
r_old_tolerance = r_global_tolerance
r_global_tolerance = 0.009
i_return_value = @
pref_global_set @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
#---------------------------------------------------------------------
# Get the global preference settings.
i_return_value = @
pref_global_get @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
# Global preference settings are
dump l_confirm, i_warning_message, r_global_tolerance
#---------------------------------------------------------------------
# Set the original values of Global preference settings.
IF (l_confirm == TRUE) THEN
l_confirm = FALSE
ELSE
l_confirm = TRUE
END IF
IF ( i_warning_message == 3 ) THEN
i_warning_message = 2
ELSE
i_warning_message = 3
END IF
r_global_tolerance = r_old_tolerance
i_return_value = @
pref_global_set @
( l_confirm, @
i_warning_message, @
r_global_tolerance )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_get_integer()
#
# In this illustration, the value of a Integer
# preference "message_warning" is changed. Then
# again the old value is set to that Integer
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_get_integer() has the following arguments:
#
# pref_env_get_integer
# ( preference_name,
# integer_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
INTEGER i_integer_value, i_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the Integer preference "message_warning"
#
s_preference_name = "message_warning"
i_return_value = @
pref_env_get_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
# Value of "message_warning" is
dump i_integer_value
#---------------------------------------------------------------------
# Set a different value to the Integer Preference.
i_old_value = i_integer_value
IF (i_integer_value == 3) THEN
i_integer_value = 2
ELSE
i_integer_value = 3
END IF
i_return_value = @
pref_env_set_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the Integer preference "message_warning"
#
i_return_value = @
pref_env_get_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
# Value of "message_warning" is
dump i_integer_value
#---------------------------------------------------------------------
# Set the original value to the Integer Preference.
i_integer_value = i_old_value
i_return_value = @
pref_env_set_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_get_logical()
#
# In this illustration, the value of a Logical
# preference "revert_enabled" is changed. Then
# again the old value is set to that Logical
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_get_logical() has the following arguments:
#
# pref_env_get_logical
# ( preference_name,
# logical_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
LOGICAL l_logical_value, l_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the Logical preference "revert_enabled"
#
s_preference_name = "revert_enabled"
#
i_return_value = @
pref_env_get_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
# Value of "revert_enabled" is
dump l_logical_value
#---------------------------------------------------------------------
# Set a different value to the Logical Preference.
l_old_value = l_logical_value
IF (l_logical_value == TRUE) THEN
l_logical_value = FALSE
ELSE
l_logical_value = TRUE
END IF
i_return_value = @
pref_env_set_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the Logical preference "revert_enabled"
#
i_return_value = @
pref_env_get_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
# Value of "revert_enabled" is
dump l_logical_value
#---------------------------------------------------------------------
# Set the old value to the Logical Preference.
l_logical_value= l_old_value
i_return_value = @
pref_env_set_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_get_real()
#
# In this illustration, the value of a real
# preference "hc_letter_ht" is changed. Then
# the old value is set to that real preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_get_real() has the following arguments:
#
# pref_env_get_real
# ( preference_name,
# real_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
REAL r_real_value, r_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the real preference "hc_letter_ht".
#
s_preference_name = "hc_letter_ht"
i_return_value = @
pref_env_get_real @
( s_preference_name, @
r_real_value )
dump i_return_value
# The value of the preference is
dump r_real_value
#---------------------------------------------------------------------
# Set a different value to the preference.
r_old_value = r_real_value
r_real_value = 0.5
i_return_value = @
pref_env_set_real @
( s_preference_name, @
r_real_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the real preference "hc_letter_ht".
#
i_return_value = @
pref_env_get_real @
( s_preference_name, @
r_real_value )
dump i_return_value
# The value of the preference is
dump r_real_value
#---------------------------------------------------------------------
# Set a different value to the preference.
r_real_value = r_old_value
i_return_value = @
pref_env_set_real @
( s_preference_name, @
r_real_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_get_string()
#
# In this illustration, the value of a String
# preference "graphics_fullcolor" is changed.
# Then again the old value is set to that String
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_get_string() has the following arguments:
#
# pref_env_get_string
# ( preference_name,
# string_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
STRING s_string_value[128], s_old_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the String preference "graphics_fullcolor"
#
s_preference_name = "graphics_fullcolor"
#
i_return_value = @
pref_env_get_string @
( s_preference_name, @
s_string_value )
dump i_return_value
# The value of the string preference is
dump s_string_value
#---------------------------------------------------------------------
# Set a different value to the String Preference
s_old_value = s_string_value
IF (s_string_value == "NO") THEN
s_string_value = "YES"
ELSE
s_string_value = "NO"
END IF
i_return_value = @
pref_env_set_string @
( s_preference_name, @
s_string_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the String preference "graphics_fullcolor"
#
i_return_value = @
pref_env_get_string @
( s_preference_name, @
s_string_value )
dump i_return_value
# The value of the string preference is
dump s_string_value
#---------------------------------------------------------------------
# Set the original value to the String Preference
s_string_value = s_old_value
i_return_value = @
pref_env_set_string @
( s_preference_name, @
s_string_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_set_integer()
#
# In this illustration, the value of an Integer
# preference "message_warning" is changed. Then
# again the old value is set to that Integer
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_set_integer() has the following arguments:
#
# pref_env_set_integer
# ( preference_name,
# integer_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
INTEGER i_integer_value, i_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the Integer preference "message_warning"
#
s_preference_name = "message_warning"
i_return_value = @
pref_env_get_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
# Value of "message_warning" is
dump i_integer_value
#---------------------------------------------------------------------
# Set a different value to the Integer Preference.
i_old_value = i_integer_value
IF (i_integer_value == 3) THEN
i_integer_value = 2
ELSE
i_integer_value = 3
END IF
i_return_value = @
pref_env_set_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the Integer preference "message_warning"
#
i_return_value = @
pref_env_get_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
# Value of "message_warning" is
dump i_integer_value
#---------------------------------------------------------------------
# Set the original value to the Integer Preference.
i_integer_value = i_old_value
i_return_value = @
pref_env_set_integer @
( s_preference_name, @
i_integer_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_set_logical()
#
# In this illustration, the value of a Logical
# preference "revert_enabled" is changed. Then
# again the old value is set to that Logical
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_set_logical() has the following arguments:
# pref_env_set_logical
# ( preference_name,
# logical_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
LOGICAL l_logical_value, l_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the Logical preference "revert_enabled"
#
s_preference_name = "revert_enabled"
#
i_return_value = @
pref_env_get_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
# Value of "revert_enabled" is
dump l_logical_value
#---------------------------------------------------------------------
# Set a different value to the Logical Preference.
l_old_value = l_logical_value
IF (l_logical_value == TRUE) THEN
l_logical_value = FALSE
ELSE
l_logical_value = TRUE
END IF
i_return_value = @
pref_env_set_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the Logical preference "revert_enabled"
#
i_return_value = @
pref_env_get_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
# Value of "revert_enabled" is
dump l_logical_value
#---------------------------------------------------------------------
# Set the old value to the Logical Preference.
l_logical_value= l_old_value
i_return_value = @
pref_env_set_logical @
( s_preference_name, @
l_logical_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_set_real()
#
# In this illustration, the value of a real
# preference "hc_letter_ht" is changed. Then
# the old value is set to that real preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_set_real() has the following arguments:
#
# pref_env_set_real
# ( preference_name,
# real_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
REAL r_real_value, r_old_value
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the real preference "hc_letter_ht".
#
s_preference_name = "hc_letter_ht"
i_return_value = @
pref_env_get_real @
( s_preference_name, @
r_real_value )
dump i_return_value
# The value of the preference is
dump r_real_value
#---------------------------------------------------------------------
# Set a different value to the preference.
r_old_value = r_real_value
r_real_value = 0.5
i_return_value = @
pref_env_set_real @
( s_preference_name, @
r_real_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the real preference "hc_letter_ht".
#
i_return_value = @
pref_env_get_real @
( s_preference_name, @
r_real_value )
dump i_return_value
# The value of the preference is
dump r_real_value
#---------------------------------------------------------------------
# Set a different value to the preference.
r_real_value = r_old_value
i_return_value = @
pref_env_set_real @
( s_preference_name, @
r_real_value )
dump i_return_value
#---------------------------------------------------------------------
() |
#
# Purpose : This file provides an example of a call to the
# function pref_env_set_string()
#
# In this illustration, the value of a String
# preference "graphics_fullcolor" is changed.
# Then again the old value is set to that String
# preference.
#
# This file can be run by starting a session of
# Patran and running this session file
# through the "File","Session","Play" pulldown
# menus on the menu bar.
#
# The function pref_env_set_string() has the following arguments:
#
# pref_env_set_string
# ( preference_name,
# string_value )
#
#---------------------------------------------------------------------
# Variable Declarations
STRING s_preference_name[128]
STRING s_string_value[128], s_old_value[128]
INTEGER i_return_value
#---------------------------------------------------------------------
# Get the value of the String preference "graphics_fullcolor"
#
s_preference_name = "graphics_fullcolor"
#
i_return_value = @
pref_env_get_string @
( s_preference_name, @
s_string_value )
dump i_return_value
# The value of the string preference is
dump s_string_value
#---------------------------------------------------------------------
# Set a different value to the String Preference
s_old_value = s_string_value
IF (s_string_value == "NO") THEN
s_string_value = "YES"
ELSE
s_string_value = "NO"
END IF
i_return_value = @
pref_env_set_string @
( s_preference_name, @
s_string_value )
dump i_return_value
#---------------------------------------------------------------------
# Get the value of the String preference "graphics_fullcolor"
#
i_return_value = @
pref_env_get_string @
( s_preference_name, @
s_string_value )
dump i_return_value
# The value of the string preference is
dump s_string_value
#---------------------------------------------------------------------
# Set the original value to the String Preference
s_string_value = s_old_value
i_return_value = @
pref_env_set_string @
( s_preference_name, @
s_string_value )
dump i_return_value
#---------------------------------------------------------------------