NAME

SetCurrentHoroscope

Display the common Windows OpenFile dialog, allowing you to choose a horoscope file
or open a existing horoscope file.

The selected horoscope become the active horoscope, and all Proastro TCL commands that need a valid horoscope will apply to this horoscope.

If several call to SetCurrentHoroscope are made, the active horoscope is the last selected one.

USAGE

SetCurrentHoroscope [{-nh nhoroscope | -path full_file_horoscope_path}] [-title str_title]

PARAMETERS

full_file_horoscope_path: if specified, is the full path of the horoscope file you want to open.

nhoroscope: if specified, the number of the horoscope to raise to the active state

str_title: the title of the open file dialog

Note that directory character separator is / not \ (à Unix).

OPTIONS

None

RETURN

1 on success, 0 on failure.

Example

#display an open file dialog

set title "Open Horoscope please"

if { ![SetCurrentHoroscope -title $title] } {

PutTxt "cannot open file or user cancel"
return
}

#open a file horoscope from disk without prompt

set my_file "//AMD_K6/c_server/Temp/pr.p22"
if { ![SetCurrentHoroscope -path $my_file] } {
puts "cannot open file: $my_file"
return
}

#Open 3 horoscope and print their name

for {set i=1} {$i <=3} {incr i} {
SetCurrentHoroscope
}

SetCurrentHoroscope -nh 1
PutTxt "[Name]"

SetCurrentHoroscope -nh 2
PutTxt "[Name]"

SetCurrentHoroscope -nh 3
PutTxt "[Name]"

Remark: All TCL Proastro functions apply to the Current horoscope
You can switch from one horoscope to another with the SetCurrentHoroscope
To get the number of opened horoscopes, use the function GetHoroscopeCount

set path "C:/dev/proastro/cpp/Nouveau dossier/Régnier_Patrick(2).xml"
if { ![SetCurrentHoroscope -path $path] } {
 PutTxt "Error opening horoscope"
}
PutTxt "Name: [Name]"

Output:
Name: Régnier

See also: RemoveHoroscope.