thank you for your response.
can you look over my code??
would you please tell me how to approach?
Thank you so much.
----this is code----
puts "<html>\n"
puts "<script>"
puts "<!--"
puts "function MM_openBrWindow(theURL,winName,features) { //v1.2"
puts "window.open(theURL,winName,features);"
puts "}//-->"
puts "</script>"
puts "<html>\n"
puts "\n"
puts "<head>\n"
puts "<meta http-equiv=\"Content-Language\" content=\"en-us\">\n"
puts "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n"
puts "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">\n"
puts "<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\n"
puts "<title>i3 Data Table</title>\n"
puts "</head>\n"
puts "\n"
puts "<body>\n"
#--form
puts "<form name=\"send\" action=\" method=\"post\">\n"
#---
puts "<table border=\"2\" style=\"border-collapse: collapse; font-family:Verdana; font-size:11px\" width=\"70\" id=\"table1\">\n"
puts " <tr>\n"
puts " <td width=\"30\">Area</td>\n"
puts " <td width=\"40\">House Number</td>\n"
puts " </tr>\n"
####################################
set readFile [open "common.txt" "r+"]
gets $readFile line
while {![eof $readFile]} {
# write the line to the backup file "output this line to a file"
set lineList1 [string map {\" ""} $line]
set storeNum [lindex $lineList1 0]
set startTime [lindex $lineList1 1]
set closeTime [lindex $lineList1 2]
set storeList1 "$storeNum $startTime $closeTime"
#puts "$storeNum $startTime $closeTime"
lappend storeList $storeList1; #list of lists
gets $readFile line
}
#-----------for loop-----
set StoreName ""
set StoreId ""
set StoreNum ""
for {set i 0} {$i < [llength $storeList]} {incr i} {
if {$StoreId == [lindex [lindex $storeList $i] 0]} {
lappend store($StoreId) [lindex $storeList $i]
} else {
set StoreId [lindex [lindex $storeList $i] 0]
lappend store($StoreId) [lindex $storeList $i]
}
if {[lsearch -exact $StoreName store($StoreId)] == -1} {
lappend StoreName store($StoreId)
lappend StoreNum $StoreId
}
}
set StoreNum [lsort -index 0 $StoreNum]
foreach elem $StoreNum {
set ssL $store($elem)
set storeOpen($elem) [lsort -index 1 $ssL]
#--new
set open1 "[lindex $storeOpen($elem) 0]"
set openIndex1 [lindex $open1 0];#house number
set openIndex2 [lindex $open1 1];#earliest opening time
set storeClose($elem) [lsort -index 2 -decreasing $ssL]
#--new
set close1 "[lindex $storeClose($elem) 0]"
set closeIndex1 [lindex $close1 2
set houseNumber $openIndex1
set startTime $openIndex2
set closeTime $closeIndex1
#####################################################3
puts " <tr>\n"
puts " <td width=\"30\">Area$houseNumber</td>\n"
puts " <td width=\"40\">\n"
#--select----
puts " <INPUT TYPE=\"hidden\" NAME=\"droplist\" VALUE=\"0\">\n"
puts " <select size=\"1\" name=\"house\" style=\"font-family: Verdana; font-size: 11px\">\n"
set numDefault ""
puts " <option value=$numDefault></option>\n"
set num1 1
puts " <option value=$num1>1</option>\n"
set num2 2
puts " <option value=$num2>2</option>\n"
set num3 3
puts " <option value=$num3>3</option>\n"
set num4 4
puts " <option value=$num4>4</option>\n"
set num5 5
puts " <option value=$num5>5</option>\n"
set num6 6
puts " <option value=$num6>6</option>\n"
set numcommon "common"
puts " <option value=$numcommon>common</option>\n"
puts " </select></td>\n"
puts " </tr>\n"
#----------------end of startUp time
} ;#end of for loop
puts "</table>\n"
puts "<p><input type=\"button\" value=\"Save\" name=\"B3\" style=\"font-family: Verdana; font-size: 11px\">\n"
puts "</body>\n"
puts "</html>\n"
-----------------------
can you look over my code??
would you please tell me how to approach?
Thank you so much.
----this is code----
puts "<html>\n"
puts "<script>"
puts "<!--"
puts "function MM_openBrWindow(theURL,winName,features) { //v1.2"
puts "window.open(theURL,winName,features);"
puts "}//-->"
puts "</script>"
puts "<html>\n"
puts "\n"
puts "<head>\n"
puts "<meta http-equiv=\"Content-Language\" content=\"en-us\">\n"
puts "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1252\">\n"
puts "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 4.0\">\n"
puts "<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\n"
puts "<title>i3 Data Table</title>\n"
puts "</head>\n"
puts "\n"
puts "<body>\n"
#--form
puts "<form name=\"send\" action=\" method=\"post\">\n"
#---
puts "<table border=\"2\" style=\"border-collapse: collapse; font-family:Verdana; font-size:11px\" width=\"70\" id=\"table1\">\n"
puts " <tr>\n"
puts " <td width=\"30\">Area</td>\n"
puts " <td width=\"40\">House Number</td>\n"
puts " </tr>\n"
####################################
set readFile [open "common.txt" "r+"]
gets $readFile line
while {![eof $readFile]} {
# write the line to the backup file "output this line to a file"
set lineList1 [string map {\" ""} $line]
set storeNum [lindex $lineList1 0]
set startTime [lindex $lineList1 1]
set closeTime [lindex $lineList1 2]
set storeList1 "$storeNum $startTime $closeTime"
#puts "$storeNum $startTime $closeTime"
lappend storeList $storeList1; #list of lists
gets $readFile line
}
#-----------for loop-----
set StoreName ""
set StoreId ""
set StoreNum ""
for {set i 0} {$i < [llength $storeList]} {incr i} {
if {$StoreId == [lindex [lindex $storeList $i] 0]} {
lappend store($StoreId) [lindex $storeList $i]
} else {
set StoreId [lindex [lindex $storeList $i] 0]
lappend store($StoreId) [lindex $storeList $i]
}
if {[lsearch -exact $StoreName store($StoreId)] == -1} {
lappend StoreName store($StoreId)
lappend StoreNum $StoreId
}
}
set StoreNum [lsort -index 0 $StoreNum]
foreach elem $StoreNum {
set ssL $store($elem)
set storeOpen($elem) [lsort -index 1 $ssL]
#--new
set open1 "[lindex $storeOpen($elem) 0]"
set openIndex1 [lindex $open1 0];#house number
set openIndex2 [lindex $open1 1];#earliest opening time
set storeClose($elem) [lsort -index 2 -decreasing $ssL]
#--new
set close1 "[lindex $storeClose($elem) 0]"
set closeIndex1 [lindex $close1 2
set houseNumber $openIndex1
set startTime $openIndex2
set closeTime $closeIndex1
#####################################################3
puts " <tr>\n"
puts " <td width=\"30\">Area$houseNumber</td>\n"
puts " <td width=\"40\">\n"
#--select----
puts " <INPUT TYPE=\"hidden\" NAME=\"droplist\" VALUE=\"0\">\n"
puts " <select size=\"1\" name=\"house\" style=\"font-family: Verdana; font-size: 11px\">\n"
set numDefault ""
puts " <option value=$numDefault></option>\n"
set num1 1
puts " <option value=$num1>1</option>\n"
set num2 2
puts " <option value=$num2>2</option>\n"
set num3 3
puts " <option value=$num3>3</option>\n"
set num4 4
puts " <option value=$num4>4</option>\n"
set num5 5
puts " <option value=$num5>5</option>\n"
set num6 6
puts " <option value=$num6>6</option>\n"
set numcommon "common"
puts " <option value=$numcommon>common</option>\n"
puts " </select></td>\n"
puts " </tr>\n"
#----------------end of startUp time
} ;#end of for loop
puts "</table>\n"
puts "<p><input type=\"button\" value=\"Save\" name=\"B3\" style=\"font-family: Verdana; font-size: 11px\">\n"
puts "</body>\n"
puts "</html>\n"
-----------------------