#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@" +q Table Fields3on preOpenStack set the style of this stack to modeless set the loc of this stack to item 3 of the screenRect / 2,(the height of this stack div 2) + 100 end preOpenStack Using Table Fields ULucida Grande WLucida Grande ULucida Grande ULucida Grande ULucida Grande ULucida GrandeULucida GrandeULucida GrandeULucida Grande WLucida GrandeWLucida Grande WLucida Grande ULucida Grande WLucida GrandeWLucida GrandeULucida GrandeWLucida Grande WLucida GrandeULucida GrandeWLucida GrandeUArial UArial WLucida GrandeWLucida Grande ULucida GrandeULucida GrandecREVGeometryCachestackID11121 cREVGeneralscriptChecksumwM$IɄ[E0 bookmarks debugObjects handlerList preOpenStackscriptSelectionchar 174 to 173 prevHandler preOpenStack tempScriptscriptE

on preOpenStack

set the style of this stack to modeless

set the loc of this stack to item 3 of the screenRect / 2,(the height of this stack div 2) + 100

end preOpenStack

 p1################################################################ ## Table handlers and functions: ## ClearTable ## EnableCellEditing ## WriteCellValue ## ReadCellValue ## SelectCell ## SetTableRowsHeight ## SetTableColumsWidth ################################################################ on ClearTable pFieldName -- public handler -- clear a table -- pFieldName parameter is the short name of the table field select empty -- if a cell is being edited, hide it put empty into fld pFieldName set the cRevTable["currentCellValue"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field set the cRevTable["currentView"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field set the cRevTable["formattedView"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field end ClearTable ---------------------------------------------------------------- on EnableCellEditing pFieldName,pFlag -- public handler -- enable or disable cell editing -- pFieldName parameter is the short name of the table field -- pFlag parameter is a boolean (true or false) select empty -- if a cell is being edited, hide it set the cREVTable["celledit"] of fld pFieldName to pFlag -- updates prop in the cRevTable of the table field end EnableCellEditing ---------------------------------------------------------------- on WriteCellValue pFieldName,pColumn,pRow,pValue -- public handler -- write data to a cell -- pFieldName parameter is the short name of the table field -- pColumn parameter is the column number (an integer) -- pRow parameter is the row number (an integer) -- pValue parameter is the text string to write select empty -- if a cell is being edited, hide it set the itemDel to tab put pValue into item pColumn of line pRow of fld pFieldName set the cRevTable["currentView"] of fld pFieldName to the htmlText of fld pFieldName -- updates prop in the cRevTable of the table field set the cRevTable["formattedView"] of fld pFieldName to the htmlText of fld pFieldName -- updates prop in the cRevTable of the table field end WriteCellValue ---------------------------------------------------------------- function ReadCellValue pFieldName,pColumn,pRow -- public handler -- read data from a cell -- pFieldName parameter is the short name of the table field -- pColumn parameter is the column number (an integer) -- pRow parameter is the row number (an integer) set the itemDel to tab return item pColumn of line pRow of fld pFieldName end ReadCellValue ---------------------------------------------------------------- on SelectCell pFieldName,pColumn,pRow -- public handler -- select a cell -- pFieldName parameter is the short name of the table field -- pColumn parameter is the column number (an integer) -- pRow parameter is the row number (an integer) SetCurXCell pFieldName,pColumn -- SetCurYCell pFieldName,pRow -- -- see SetCurXCell and SetCurYCell private handlers below: update prop ----- SetScroll "hScroll",the cRevTable["cellxspacing"] of fld pFieldName * (pColumn - 1),pFieldName,"Header" -- SetScroll "vScroll",the cRevTable["cellyspacing"] of fld pFieldName * (pRow - 1),pFieldName,"Rows" -- -- see SetScroll private handler below: used to update header fields scrolls ----- click at CellLoc(pFieldName,pColumn,pRow) -- ----- -- to select again the current cell, you can use: -- click at the cRevTable["currentxmouseloc"] of fld pFieldName,the cRevTable["currentymouseloc"] of fld pFieldName end SelectCell ---------------------------------------------------------------- on SetTableRowsHeight pFieldName,pHeight -- public handler -- sets the table rows height -- pFieldName parameter is the short name of the table field -- pHeight parameter is an integer set the textHeight of fld pFieldName to pHeight -- in fact this line is not compulsory set the textSize of fld pFieldName to round(pHeight/4*3) set the fixedLineHeight of fld pFieldName to true set the cRevTable["cellyspacing"] of fld pFieldName to pHeight end SetTableRowsHeight ---------------------------------------------------------------- on SetTableColumsWidth pFieldName,pWidth -- public handler -- sets the table columns width -- pFieldName parameter is the short name of the table field -- pWidth parameter is an integer set the tabStops of fld pFieldName to pWidth set the cRevTable["cellxspacing"] of fld pFieldName to pWidth end SetTableColumsWidth ---------------------------------------------------------------- on SetCurXCell pFieldName,pValue -- private handler -- updates prop in the cRevTable of the table field -- pFieldName parameter is the short name of the table field -- pValue parameter is the column number (an integer) set the cRevTable["currentxcell"] of fld pFieldName to pValue end SetCurXCell ---------------------------------------------------------------- on SetCurYCell pFieldName,pValue -- private handler -- updates prop in the cRevTable of the table field -- pFieldName parameter is the short name of the table field -- pValue parameter is the row number (an integer) set the cRevTable["currentycell"] of fld pFieldName to pValue end SetCurYCell ---------------------------------------------------------------- on SetScroll -- private handler -- sets the table field and header fields scrolls if they are any -- the syntax is not very comprehensible since this handler can set the scroll of an unknown number of fields -- then it refers to parameters by order/number and not by name using the do command lock screen lock messages repeat with i = 3 to the paramcount do "put there is a fld" && param(i) && "into tFlag" if tFlag then do "set the" && param(1) && "of fld" && param(i) && "to" && param(2) -- param (3) to param(x) are the names of the fields end repeat unlock messages unlock screen end SetScroll ---------------------------------------------------------------- function CellLoc pFieldName,pColumn,pRow -- private function -- returns the loc of any cell -- pFieldName parameter is the short name of the table field -- pColumn parameter is the column number (an integer) -- pRow parameter is the row number (an integer) local tLeft,tTop,tCellxspacing,tCellyspacing,tCurrenthscroll,tCurrentvscroll ----- put the left of fld pFieldName into tLeft put the top of fld pFieldName into tTop put the cRevTable["cellxspacing"] of fld pFieldName into tCellxspacing put the cRevTable["cellyspacing"] of fld pFieldName into tCellyspacing put the hScroll of fld pFieldName into tCurrenthscroll put the vScroll of fld pFieldName into tCurrentvscroll return ((pColumn - 1) * tCellxspacing) + (tCellxspacing div 2) + tLeft - tCurrenthscroll, \ ((pRow - 1) * tCellyspacing) + (tCellyspacing div 2) + tTop - tCurrentvscroll end CellLoc ################################################################ ## Other handlers and functions ################################################################ function ColumnNumber pLabel -- returns the correct number for columns from A to ZZ if the number of chars of pLabel = 1 then return charToNum(pLabel) - 64 else return (charToNum(last char of pLabel) - 64) + (charToNum(first char of pLabel) - 64) * 26 end ColumnNumber ---------------------------------------------------------------- on rawKeyDown pKey -- allows tabbing and arrowkeys to act in carousel -- horizontal and vertical limits are stored in 2 custom properties (xLimit and yLimit) in the table field if "revCell" is in the target then -- when editing a table field, target function returns something like: field "revCell-1,1" if the xLimit of fld "MyTable" = "None" or the xLimit of fld "MyTable" is empty then pass rawKeyDown -- no limits ----- switch pKey case 65363 -- arrow key right case 65289 -- tab key if the cRevTable["currentxcell"] of fld "MyTable" = the xLimit of fld "MyTable" then if the cRevTable["currentycell"] of fld "MyTable" = the yLimit of fld "MyTable" then SelectCell "MyTable",1,1 -- the first table cell else SelectCell "MyTable",1,the cRevTable["currentycell"] of fld "MyTable" + 1 -- the first table cell in the next line end if else pass rawKeyDown break ----- case 65361 -- arrow key left if the cRevTable["currentxcell"] of fld "MyTable" = 1 then if the cRevTable["currentycell"] of fld "MyTable" <> 1 then SelectCell "MyTable",the xLimit of fld "MyTable",the cRevTable["currentycell"] of fld "MyTable" - 1 -- -- the last allowed table cell in the previous line else SelectCell "MyTable",the xLimit of fld "MyTable",the yLimit of fld "MyTable" -- -- the last allowed table cell end if else pass rawKeyDown break ----- case 65364 -- arrow key down if the cRevTable["currentycell"] of fld "MyTable" = the yLimit of fld "MyTable" then if the cRevTable["currentxcell"] of fld "MyTable" = the xLimit of fld "MyTable" then SelectCell "MyTable",1,1 -- the first table cell else SelectCell "MyTable",the cRevTable["currentxcell"] of fld "MyTable" + 1,1 -- -- the first table cell in the next column else pass rawKeyDown break ----- case 65362 -- arrow key up if the cRevTable["currentycell"] of fld "MyTable" = 1 then if the cRevTable["currentxcell"] of fld "MyTable" <> 1 then SelectCell "MyTable",the cRevTable["currentxcell"] of fld "MyTable" - 1,the yLimit of fld "MyTable" -- -- the last allowed table cell in the previous column else SelectCell "MyTable",the xLimit of fld "MyTable",the yLimit of fld "MyTable" -- -- the last allowed table cell else pass rawKeyDown break ----- default pass rawKeyDown -- lets the engine do it end switch else pass rawKeyDown end rawKeyDown ################################################################ ## Bonus functions ################################################################ function PopulateWithLetters -- generates a tab delimited list from A to ZZ (limited here to CZ) local tList ----- repeat with i = 65 to 90 put numToChar(i) & tab after tList end repeat ----- repeat with i = 65 to 90 repeat with j = 65 to 90 put numToChar(i) & numToChar(j) & tab after tList end repeat end repeat ----- return tList end PopulateWithLetters ---------------------------------------------------------------- function PopulateWithNumbers -- generates a return delimited list of integers local tList ----- repeat with i = 1 to 256 put i & cr after tList end repeat return tList end PopulateWithNumbers ################################################################ ## Demo purposes handlers ################################################################ on rawKeyUp if "revCell" is in the target then UpdateProps -- -- when editing a table field, target function returns something like: field "revCell-1,1" pass rawKeyUp end rawKeyUp ---------------------------------------------------------------- on UpdateProps local tOldProps,tProps,tProp,tCurData ----- lock screen set the label of btn "Column" to line (the cREVTable["currentxcell"] of fld "MyTable") of btn "Column" set the menuHistory of btn "Column" to the cREVTable["currentxcell"] of fld "MyTable" set the label of btn "Row" to the cREVTable["currentycell"] of fld "MyTable" set the menuHistory of btn "Row" to the cREVTable["currentycell"] of fld "MyTable" put ReadCellValue("MyTable",the cREVTable["currentxcell"] of fld "MyTable",the cREVTable["currentycell"] of fld "MyTable") into tCurData put tCurData into fld "Data" set the enabled of btn "Clear Cell" to tCurData <> empty ----- put fld "Props" into tOldProps put the uTableProps of this cd into tProps set the itemDel to tab repeat with i = 1 to the number of lines of tProps do "put the cRevTable[" & quote & line i of tProps & quote & "] of fld" && quote & "MyTable" & quote && "into tProp" replace cr with "" in tProp put tProp into item 2 of line i of tProps end repeat put tProps into fld "Props" unlock screen end UpdateProps ---------------------------------------------------------------- on resizeStack -- system handler revUpdateGeometry set the vScrollBar of fld "Props" to the height of fld "Props" < 429 end resizeStack  uTablePropscurrentxcell currentycell celledit cellformat cellxspacing cellyspacing currentcellvalue currentview formattedview viewablecolumns viewablerows currenthscroll currentvscroll currentxmouseloc currentymouseloc formatcellline formattypeline formatvalueline numbertabstops returnedview topcellloc leftcellloc rightcellloc bottomcellloc topfieldloc leftfieldloc rightfieldloc bottomfieldloc scrollbarwidthcREVGeometryCacheIDs'11157217160322048111581470892746441115733056268160011158209378306504111572048442220001115882949345773811157326559342442111588294934677391115882949347774011158829493487741111580267179336381115740722284343011157326661602444111573276603522391115820499160648011157328649192446111572552126620511115729719189235911158245459966947111572127526720411115728701717223211157217160012049111658474419211120111658474419311121111572051228420011115712244199110111158014684973542111571791221216351115730563774236411157110191811004111572066009920031115735434067246611157305812862366111581646773048471115720843236201211158289299407737111572067698720041115731828825240411158165833304848cREVGeometrycacheorderb1115730581286 1115717912212 1115820499160 1115732655934 1115732864919 1115824545996 1115732766035 total39 cREVGeneralscriptChecksumm!lTi5 bookmarks handlerListClearTable EnableCellEditing WriteCellValue ReadCellValue SelectCell SetTableRowsHeight SetTableColumsWidth SetCurXCell SetCurYCell SetScroll CellLoc ColumnNumber rawKeyDown PopulateWithLetters PopulateWithNumbers rawKeyUp UpdateProps resizeStack breakPoints tempScript prevHandler SelectCellscriptSelection char 1 to 0scriptj0

################################################################

## Table handlers and functions:

## ClearTable

## EnableCellEditing

## WriteCellValue

## ReadCellValue

## SelectCell

## SetTableRowsHeight

## SetTableColumsWidth

################################################################

on ClearTable pFieldName

-- public handler

-- clear a table

-- pFieldName parameter is the short name of the table field

select empty -- if a cell is being edited, hide it

put empty into fld pFieldName

set the cRevTable["currentCellValue"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field

set the cRevTable["currentView"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field

set the cRevTable["formattedView"] of fld pFieldName to empty -- updates prop in the cRevTable of the table field

end ClearTable

----------------------------------------------------------------

on EnableCellEditing pFieldName,pFlag

-- public handler

-- enable or disable cell editing

-- pFieldName parameter is the short name of the table field

-- pFlag parameter is a boolean (true or false)

select empty -- if a cell is being edited, hide it

set the cREVTable["celledit"] of fld pFieldName to pFlag -- updates prop in the cRevTable of the table field

end EnableCellEditing

----------------------------------------------------------------

on WriteCellValue pFieldName,pColumn,pRow,pValue

-- public handler

-- write data to a cell

-- pFieldName parameter is the short name of the table field

-- pColumn parameter is the column number (an integer)

-- pRow parameter is the row number (an integer)

-- pValue parameter is the text string to write

select empty -- if a cell is being edited, hide it

set the itemDel to tab

put pValue into item pColumn of line pRow of fld pFieldName

set the cRevTable["currentView"] of fld pFieldName to the htmlText of fld pFieldName -- updates prop in the cRevTable of the table field

set the cRevTable["formattedView"] of fld pFieldName to the htmlText of fld pFieldName -- updates prop in the cRevTable of the table field

end WriteCellValue

----------------------------------------------------------------

function ReadCellValue pFieldName,pColumn,pRow

-- public handler

-- read data from a cell

-- pFieldName parameter is the short name of the table field

-- pColumn parameter is the column number (an integer)

-- pRow parameter is the row number (an integer)

set the itemDel to tab

return item pColumn of line pRow of fld pFieldName

end ReadCellValue

----------------------------------------------------------------

on SelectCell pFieldName,pColumn,pRow

-- public handler

-- select a cell

-- pFieldName parameter is the short name of the table field

-- pColumn parameter is the column number (an integer)

-- pRow parameter is the row number (an integer)

SetCurXCell pFieldName,pColumn -- 

SetCurYCell pFieldName,pRow -- 

-- see SetCurXCell and SetCurYCell private handlers below: update prop

-----

SetScroll "hScroll",the cRevTable["cellxspacing"] of fld pFieldName * (pColumn - 1),pFieldName,"Header" -- 

SetScroll "vScroll",the cRevTable["cellyspacing"] of fld pFieldName * (pRow - 1),pFieldName,"Rows" -- 

-- see SetScroll private handler below: used to update header fields scrolls

-----

click at CellLoc(pFieldName,pColumn,pRow) -- 

-----

-- to select again the current cell, you can use:

-- click at the cRevTable["currentxmouseloc"] of fld pFieldName,the cRevTable["currentymouseloc"] of fld pFieldName

end SelectCell

----------------------------------------------------------------

on SetTableRowsHeight pFieldName,pHeight

-- public handler

-- sets the table rows height

-- pFieldName parameter is the short name of the table field

-- pHeight parameter is an integer

set the textHeight of fld pFieldName to pHeight

-- in fact this line is not compulsory

set the textSize of fld pFieldName to round(pHeight/4*3)

set the fixedLineHeight of fld pFieldName to true

set the cRevTable["cellyspacing"] of fld pFieldName to pHeight

end SetTableRowsHeight

----------------------------------------------------------------

on SetTableColumsWidth pFieldName,pWidth

-- public handler

-- sets the table columns width

-- pFieldName parameter is the short name of the table field

-- pWidth parameter is an integer

set the tabStops of fld pFieldName to pWidth

set the cRevTable["cellxspacing"] of fld pFieldName to pWidth

end SetTableColumsWidth

----------------------------------------------------------------

on SetCurXCell pFieldName,pValue

-- private handler

-- updates prop in the cRevTable of the table field

-- pFieldName parameter is the short name of the table field

-- pValue parameter is the column number (an integer)

set the cRevTable["currentxcell"] of fld pFieldName to pValue

end SetCurXCell

----------------------------------------------------------------

on SetCurYCell pFieldName,pValue

-- private handler

-- updates prop in the cRevTable of the table field

-- pFieldName parameter is the short name of the table field

-- pValue parameter is the row number (an integer)

set the cRevTable["currentycell"] of fld pFieldName to pValue

end SetCurYCell

----------------------------------------------------------------

on SetScroll

-- private handler

-- sets the table field and header fields scrolls if they are any

-- the syntax is not very comprehensible since this handler can set the scroll of an unknown number of fields

-- then it refers to parameters by order/number and not by name using the do command

lock screen

lock messages

repeat with i = 3 to the paramcount

do "put there is a fld" && param(i) && "into tFlag"

if tFlag then do "set the" && param(1) && "of fld" && param(i) && "to" && param(2)

-- param (3) to param(x) are the names of the fields

end repeat

unlock messages

unlock screen

end SetScroll

----------------------------------------------------------------

function CellLoc pFieldName,pColumn,pRow

-- private function

-- returns the loc of any cell

-- pFieldName parameter is the short name of the table field

-- pColumn parameter is the column number (an integer)

-- pRow parameter is the row number (an integer)

local tLeft,tTop,tCellxspacing,tCellyspacing,tCurrenthscroll,tCurrentvscroll

-----

put the left of fld pFieldName into tLeft

put the top of fld pFieldName into tTop

put the cRevTable["cellxspacing"] of fld pFieldName into tCellxspacing

put the cRevTable["cellyspacing"] of fld pFieldName into tCellyspacing

put the hScroll of fld pFieldName into tCurrenthscroll

put the vScroll of fld pFieldName into tCurrentvscroll

return ((pColumn - 1) * tCellxspacing) + (tCellxspacing div 2) + tLeft - tCurrenthscroll, \

((pRow - 1) * tCellyspacing) + (tCellyspacing div 2) + tTop - tCurrentvscroll

end CellLoc

################################################################

## Other handlers and functions

################################################################

function ColumnNumber pLabel -- returns the correct number for columns from A to ZZ

if the number of chars of pLabel = 1 then return charToNum(pLabel) - 64

else return (charToNum(last char of pLabel) - 64) + (charToNum(first char of pLabel) - 64) * 26

end ColumnNumber

----------------------------------------------------------------

on rawKeyDown pKey

-- allows tabbing and arrowkeys to act in carousel

-- horizontal and vertical limits are stored in 2 custom properties (xLimit and yLimit) in the table field

if "revCell" is in the target then

-- when editing a table field, target function returns something like: field "revCell-1,1"

if the xLimit of fld "MyTable" = "None" or the xLimit of fld "MyTable" is empty then pass rawKeyDown -- no limits

-----

switch pKey

case 65363 -- arrow key right

case 65289 -- tab key

if the cRevTable["currentxcell"] of fld "MyTable" = the xLimit of fld "MyTable" then

if the cRevTable["currentycell"] of fld "MyTable" = the yLimit of fld "MyTable" then

SelectCell "MyTable",1,1 -- the first table cell

else

SelectCell "MyTable",1,the cRevTable["currentycell"] of fld "MyTable" + 1 -- the first table cell in the next line

end if

else pass rawKeyDown

break

-----

case 65361 -- arrow key left

if the cRevTable["currentxcell"] of fld "MyTable" = 1 then

if the cRevTable["currentycell"] of fld "MyTable" <> 1 then

SelectCell "MyTable",the xLimit of fld "MyTable",the cRevTable["currentycell"] of fld "MyTable" - 1 -- 

-- the last allowed table cell in the previous line

else

SelectCell "MyTable",the xLimit of fld "MyTable",the yLimit of fld "MyTable" -- 

-- the last allowed table cell

end if

else pass rawKeyDown

break

-----

case 65364 -- arrow key down

if the cRevTable["currentycell"] of fld "MyTable" = the yLimit of fld "MyTable" then

if the cRevTable["currentxcell"] of fld "MyTable" = the xLimit of fld "MyTable" then

SelectCell "MyTable",1,1 -- the first table cell

else SelectCell "MyTable",the cRevTable["currentxcell"] of fld "MyTable" + 1,1 -- 

-- the first table cell in the next column

else pass rawKeyDown

break

-----

case 65362 -- arrow key up

if the cRevTable["currentycell"] of fld "MyTable" = 1 then

if the cRevTable["currentxcell"] of fld "MyTable" <> 1 then

SelectCell "MyTable",the cRevTable["currentxcell"] of fld "MyTable" - 1,the yLimit of fld "MyTable" -- 

-- the last allowed table cell in the previous column

else SelectCell "MyTable",the xLimit of fld "MyTable",the yLimit of fld "MyTable" -- 

-- the last allowed table cell

else pass rawKeyDown

break

-----

default

pass rawKeyDown -- lets the engine do it

end switch

else pass rawKeyDown

end rawKeyDown

################################################################

## Bonus functions

################################################################

function PopulateWithLetters -- generates a tab delimited list from A to ZZ (limited here to CZ)

local tList

-----

repeat with i = 65 to 90

put numToChar(i) & tab after tList

end repeat

-----

repeat with i = 65 to 90

repeat with j = 65 to 90

put numToChar(i) & numToChar(j) & tab after tList

end repeat

end repeat

-----

return tList

end PopulateWithLetters

----------------------------------------------------------------

function PopulateWithNumbers -- generates a return delimited list of integers

local tList

-----

repeat with i = 1 to 256

put i & cr after tList

end repeat

return tList

end PopulateWithNumbers

################################################################

## Demo purposes handlers

################################################################

on rawKeyUp

if "revCell" is in the target then UpdateProps -- 

-- when editing a table field, target function returns something like: field "revCell-1,1"

pass rawKeyUp

end rawKeyUp

----------------------------------------------------------------

on UpdateProps

local tOldProps,tProps,tProp,tCurData

-----

lock screen

set the label of btn "Column" to line (the cREVTable["currentxcell"] of fld "MyTable") of btn "Column"

set the menuHistory of btn "Column" to the cREVTable["currentxcell"] of fld "MyTable"

set the label of btn "Row" to the cREVTable["currentycell"] of fld "MyTable"

set the menuHistory of btn "Row" to the cREVTable["currentycell"] of fld "MyTable"

put ReadCellValue("MyTable",the cREVTable["currentxcell"] of fld "MyTable",the cREVTable["currentycell"] of fld "MyTable") into tCurData

put tCurData into fld "Data"

set the enabled of btn "Clear Cell" to tCurData <> empty

-----

put fld "Props" into tOldProps

put the uTableProps of this cd into tProps

set the itemDel to tab

repeat with i = 1 to the number of lines of tProps

do "put the cRevTable[" & quote & line i of tProps & quote & "] of fld" && quote & "MyTable" & quote && "into tProp"

replace cr with "¬" in tProp

put tProp into item 2 of line i of tProps

end repeat

put tProps into fld "Props"

unlock screen

end UpdateProps

----------------------------------------------------------------

on resizeStack -- system handler

revUpdateGeometry

set the vScrollBar of fld "Props" to the height of fld "Props" < 429

end resizeStack

 cREVTableacellfalse > < @+p+q <Actioni-/: cREVGeneral revUniqueID 1115730563774 hBg p_on enterInField end enterInField on returnInField end returnInField on rawKeyUp end rawKeyUp @1Y cREVGeneralscriptChecksum؅050_jK bookmarks revUniqueID 1115820937830 handlerList#enterInField returnInField rawKeyUpscriptSelection char 80 to 79 prevHandler enterInField tempScriptscripta

on enterInField

end enterInField

on returnInField

end returnInField

on rawKeyUp

end rawKeyUp

 6Rows -zon mouseUp UpdateProps -- C end mouseUp ---------------------------------- on scrollBarDrag lock screen set the hScroll of fld "Header" to the hScroll of me unlock screen end scrollBarDrag ---------------------------------- on rawKeyUp scrollBarDrag end rawKeyUp ---------------------------------- setProp cRevTable set the hScroll of fld "Header" to the hScroll of me pass cRevTable end cRevTable xxxxxx@1i2 cREVTablecurrentvscroll0formattedview currenthscroll0currentxmouseloc152 viewablerows14currentymouseloc85scrollbarwidth20 cellyspacing14rightfieldloc75viewablecolumns1numbertabstops1 topfieldloc105 leftfieldloc49 cellxspacing50 currentview bottomfieldloc294 cREVGeneral scriptChecksum|*]+SDtablefalse handlerList(mouseUp scrollBarDrag rawKeyUp cRevTablescriptSelectionchar 274 to 273 bookmarks revUniqueID 1115802671793 prevHandler cRevTable tempScriptscript

on mouseUp

UpdateProps -- C

end mouseUp

----------------------------------

on scrollBarDrag

lock screen

set the hScroll of fld "Header" to the hScroll of me

unlock screen

end scrollBarDrag

----------------------------------

on rawKeyUp

scrollBarDrag

end rawKeyUp

----------------------------------

setProp cRevTable

set the hScroll of fld "Header" to the hScroll of me

pass cRevTable

end cRevTable

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 cProps)axxxxxx@1x' cREVGeometry Master,expectedRect49,416,692,592Master,scalebottomDistance-78Master,movevDistancefalseMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,cardRanking1Master,scaleBottomtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneral revUniqueID 1115717912212  currentxcell 1 currentycell 1 celledit true cellformat false cellxspacing 100 cellyspacing 14 currentcellvalue currentview

128

256

512

1024

2048

formattedview

128

256

512

1024

2048

viewablecolumns 5 viewablerows 15 currenthscroll 0 currentvscroll 0 currentxmouseloc 122 currentymouseloc 133 formatcellline formattypeline formatvalueline numbertabstops 1 returnedview topcellloc 120 leftcellloc 77 rightcellloc 177 bottomcellloc 141 topfieldloc 105 leftfieldloc 74 rightfieldloc 494 bottomfieldloc 310 scrollbarwidth 16+i ` a2?r Data)pon enterInField WriteIt -- end enterInField ------------------------------------------ on returnInField WriteIt -- end returnInField ------------------------------------------ on WriteIt click at the loc of btn "Write Data to Cell" end WriteIt pJ~ cREVGeneralscriptChecksum2@4_jzZ, revUniqueID 1115720843236 bookmarks handlerList"enterInField returnInField WriteIt tempScript prevHandler enterInFieldscriptSelectionchar 233 to 232script

on enterInField

WriteIt -- 

end enterInField

------------------------------------------

on returnInField

WriteIt -- 

end returnInField

------------------------------------------

on WriteIt

click at the loc of btn "Write Data to Cell"

end WriteIt

 128 Clear TableEpon mouseUp ClearTable "MyTable" -- C ----- put empty into fld "Data" disable btn "Clear Cell" UpdateProps -- C end mouseUp 1Kd cREVGeneral scriptChecksum#akZ~ʎ breakPoints handlerListmouseUpscriptSelection char 12 to 11 bookmarks revUniqueID 1115721275267 prevHandlermouseUp tempScriptscript

on mouseUp

ClearTable "MyTable" -- C

-----

put empty into fld "Data"

disable btn "Clear Cell"

UpdateProps -- C

end mouseUp

Header  ixxxxxx@JYd cREVTableformattedview currentxmouseloc38currenthscroll0currentymouseloc31scrollbarwidth20 cellyspacing14rightfieldloc478 topfieldloc89 leftfieldloc74 cellxspacing100 currentview currentvscroll0 viewablerows2viewablecolumns6numbertabstops1 celledittruebottomfieldloc106 cREVGeneraltablefalse revUniqueID 1115725521266 bookmarks handlerList tempScript prevHandlerscript  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA AB AC AD AE AF AG AH AI AJ AK AL AM AN AO AP AQ AR AS AT AU AV AW AX AY AZ BA BB BC BD BE BF BG BH BI BJ BK BL BM BN BO BP BQ BR BS BT BU BV BW BX BY BZ CA CB CC CD CE CF CG CH CI CJ CK CL CM CN CO CP CQ CR CS CT CU CV CW CX CY CZ MyTable ){on mouseUp UpdateProps -- C end mouseUp ---------------------------------- on scrollBarDrag lock screen set the vScroll of fld "Rows" to the vScroll of me -- Rows is the name of the left vertical field set the hScroll of fld "Header" to the hScroll of me -- Header is the name of the top horizontal field UpdateProps -- C unlock screen end scrollBarDrag ---------------------------------- on rawKeyUp scrollBarDrag end rawKeyUp ---------------------------------- setProp cRevTable -- you can use this control structure to trigger when any property in the cRevTable set is changed by the engine scrollBarDrag -- pass cRevTable end cRevTable xxxxxx@JiyLimit20xLimit5d cREVTableformatcellline topcellloc120 leftcellloc77formattedview

128

256

512

1024

2048

currenthscroll0currentxmouseloc122bottomcellloc141currentymouseloc133 returnedviewscrollbarwidth16 rightcellloc177 cellyspacing14rightfieldloc494 cellxspacing100 leftfieldloc74 topfieldloc105 currentview

128

256

512

1024

2048

formatvaluelinecurrentvscroll0 viewablerows15 currentxcell1 currentycell1viewablecolumns5currentcellvalue cellformatfalsenumbertabstops1formattypeline celledittruebottomfieldloc310 cREVGeneral tabletruescriptChecksumi:S=%k/o handlerList(mouseUp scrollBarDrag rawKeyUp cRevTablescriptSelectionchar 668 to 667 revUniqueID 1115711019181 bookmarks tempScript prevHandler cRevTablescript

on mouseUp

UpdateProps -- C

end mouseUp

----------------------------------

on scrollBarDrag

lock screen

set the vScroll of fld "Rows" to the vScroll of me

-- Rows is the name of the left vertical field

set the hScroll of fld "Header" to the hScroll of me

-- Header is the name of the top horizontal field

UpdateProps -- C

unlock screen

end scrollBarDrag

----------------------------------

on rawKeyUp

scrollBarDrag

end rawKeyUp

----------------------------------

setProp cRevTable

-- you can use this control structure to trigger when any property in the cRevTable set is changed by the engine

scrollBarDrag -- 

pass cRevTable

end cRevTable

 /128   256  512  1024 2048  , ,  `j7 aK%Allow Cell EditinghEon mouseUp EnableCellEditing "MyTable",the hilite of me -- C ----- set the enabled of btn "Select Cell" to the hilite of me UpdateProps -- C end mouseUp 13 cREVGeneralscriptChecksumX&_'<0 revUniqueID 1115728701717 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 72 to 71script~

on mouseUp

EnableCellEditing "MyTable",the hilite of me -- C

-----

set the enabled of btn "Select Cell" to the hilite of me

UpdateProps -- C

end mouseUp

 7 Label Field 1 cREVGeneral revUniqueID 1115729719189 pBelow are the properties implemented by the engine for a table field (the cRevTable property set of the field): d Clear CellEpon mouseUp local tColumn,tRow,tValue ----- put the label of btn "Row" into tRow put ColumnNumber(the label of btn "Column") into tColumn -- C -- this function returns the column number from the used notation (A, B, ..., AA, AB, etc) -- see in the script of this cd put empty into tValue WriteCellValue "MyTable",tColumn,tRow,tValue -- C -- see in the script of this cd UpdateProps -- C end mouseUp Kd cREVGeneral scriptChecksumkj36Wx breakPoints handlerListmouseUpscriptSelection char 48 to 47 bookmarks revUniqueID 1115731828825 prevHandlermouseUp tempScriptscript

on mouseUp

local tColumn,tRow,tValue

-----

put the label of btn "Row" into tRow

put ColumnNumber(the label of btn "Column") into tColumn -- C

-- this function returns the column number from the used notation (A, B, ..., AA, AB, etc)

-- see in the script of this cd

put empty into tValue

WriteCellValue "MyTable",tColumn,tRow,tValue -- C

-- see in the script of this cd

UpdateProps -- C

end mouseUp

 Current Cell i  7N cREVGeneral revUniqueID 1115735434067Row uon menuPick pItem put the label of me into tRow SetCurYCell "MyTable",tRow -- C ----- UpdateProps -- C end menuPick pi<1Q1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 cREVGeneralscriptChecksumM5ުLt bookmarks revUniqueID 1115720484422 handlerListmenuPickscriptSelection char 93 to 92 prevHandlermenuPick tempScriptscript

on menuPick pItem

put the label of me into tRow

SetCurYCell "MyTable",tRow -- C

-----

UpdateProps -- C

end menuPick

Column uon menuPick pItem put ColumnNumber(the label of me) into tColumn -- C SetCurXCell "MyTable",tColumn -- C ----- UpdateProps -- C end menuPick pL<AA B C D E F G H I J K L M N O P Q R S T U V W X Y Z AA AB AC AD AE AF AG AH AI AJ AK AL AM AN AO AP AQ AR AS AT AU AV AW AX AY AZ BA BB BC BD BE BF BG BH BI BJ BK BL BM BN BO BP BQ BR BS BT BU BV BW BX BY BZ CA CB CC CD CE CF CG CH CI CJ CK CL CM CN CO CP CQ CR CS CT CU CV CW CX CY CZ  cREVGeneralscriptChecksumjwn2 revUniqueID 1115720512284 bookmarks handlerListmenuPickscriptSelectionchar 119 to 118 tempScript prevHandlermenuPickscript

on menuPick pItem

put ColumnNumber(the label of me) into tColumn -- C

SetCurXCell "MyTable",tColumn -- C

-----

UpdateProps -- C

end menuPick

 Label Field :h: cREVGeneral revUniqueID 1115720660099 Row:  Label Field 2KB cREVGeneral revUniqueID 1115720676987 Column: f Select CellEp|on mouseUp local tColumn,tRow ----- put the label of btn "Row" into tRow put ColumnNumber(the label of btn "Column") into tColumn -- C -- this function returns the column number from the used notation (A, B, ..., AA, AB, etc) -- see in the script of this cd SelectCell "MyTable",tColumn,tRow -- C -- see in the script of this cd UpdateProps -- C end mouseUp hd cREVGeneral scriptChecksumon mouseUp

local tColumn,tRow

-----

put the label of btn "Row" into tRow

put ColumnNumber(the label of btn "Column") into tColumn -- C

-- this function returns the column number from the used notation (A, B, ..., AA, AB, etc)

-- see in the script of this cd

SelectCell "MyTable",tColumn,tRow -- C

-- see in the script of this cd

UpdateProps -- C

end mouseUp

MWrite Data to CellEpon mouseUp local tColumn,tRow,tValue ----- put ColumnNumber(the label of btn "Column") into tColumn -- C -- this function returns the column number from the used notation (A, B, ..., AA, AB, etc) -- see in the script of this cd put the label of btn "Row" into tRow put fld "Data" into tValue if tValue = empty then beep select text of fld "Data" else WriteCellValue "MyTable",tColumn,tRow,tValue -- C -- see in the script of this cd UpdateProps -- C end if end mouseUp ph~ cREVGeneral scriptChecksumeޠ/Th# breakPoints handlerListmouseUpscriptSelection char 20 to 19 bookmarks revUniqueID 1115712244199 prevHandlermouseUp tempScriptscriptv

on mouseUp

local tColumn,tRow,tValue

-----

put ColumnNumber(the label of btn "Column") into tColumn -- C

-- this function returns the column number from the used notation (A, B, ..., AA, AB, etc)

-- see in the script of this cd

put the label of btn "Row" into tRow

put fld "Data" into tValue

if tValue = empty then

beep

select text of fld "Data"

else

WriteCellValue "MyTable",tColumn,tRow,tValue -- C

-- see in the script of this cd

UpdateProps -- C

end if

end mouseUp

Label Field @J. cREVGeneral revUniqueID 1115801468497 Data: Table Format i  \N cREVGeneral revUniqueID 1115816583330 bookmarks handlerList tempScript prevHandlerscript ColumnWidth uon menuPick pItem lock screen SetTableColumsWidth "MyTable",pItem -- C SetTableColumsWidth "Header",pItem -- C unlock screen ----- UpdateProps -- C end menuPick p<10050 75 100 125 150 175 200 cREVGeneralscriptChecksumcd/ϖZ ] revUniqueID 1115721716032 bookmarks handlerListmenuPick tempScript prevHandlermenuPickscriptSelectionchar 119 to 118script1

on menuPick pItem

lock screen

SetTableColumsWidth "MyTable",pItem -- C

SetTableColumsWidth "Header",pItem -- C

unlock screen

-----

UpdateProps -- C

end menuPick

 Label Field d cREVGeneral revUniqueID 1115721716001 Columns Width:$ RowHeight uon menuPick pItem lock screen SetTableRowsHeight "MyTable",pItem -- C SetTableRowsHeight "Rows",pItem -- C unlock screen ----- UpdateProps -- C end menuPick pq<1410 12 14 16 18 20 cREVGeneralscriptChecksum$#h=;QD= bookmarks revUniqueID 1115814708927 handlerListmenuPickscriptSelectionchar 115 to 114 prevHandlermenuPick tempScriptscript/

on menuPick pItem

lock screen

SetTableRowsHeight "MyTable",pItem -- C

SetTableRowsHeight "Rows",pItem -- C

unlock screen

-----

UpdateProps -- C

end menuPick

 Label Field p[ cREVGeneral revUniqueID 1115816467730 Rows Height: P Label Field xxxxxx1P cREVGeometry Master,expectedRect49,592,699,613Master,scalebottomDistanceMaster,movevDistance-68Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,moveVObjectRefcardMaster,moveVAbsolutetrueMaster,cardRanking1 Master,moveVtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneral revUniqueID 1115820499160 ZIf you have a large screen, you might want to resize this stack to show all properties...9 Table Limits i  N cREVGeneral revUniqueID 1115828929940:VLimit uon menuPick pItem set the yLimit of fld "MyTable" to pItem if pItem = "None" then set the xLimit of fld "MyTable" to pItem set the label of btn "HLimit" to "None" set the menuHistory of btn "HLimit" to lineOffset("None",btn "HLimit") end if end menuPick p<205 6 7 8 9 10 20 None cREVGeneralscriptChecksumGrO Rƻ7 bookmarks revUniqueID 1115882949345 handlerListmenuPickscriptSelectionchar 248 to 247 prevHandlermenuPick tempScriptscriptW

on menuPick pItem

set the yLimit of fld "MyTable" to pItem

if pItem = "None" then

set the xLimit of fld "MyTable" to pItem

set the label of btn "HLimit" to "None"

set the menuHistory of btn "HLimit" to lineOffset("None",btn "HLimit")

end if

end menuPick

; Label Field  j cREVGeneral revUniqueID 1115882949346 Vertical:<HLimit uon menuPick pItem set the xLimit of fld "MyTable" to pItem if pItem = "None" then set the yLimit of fld "MyTable" to pItem set the label of btn "VLimit" to "None" set the menuHistory of btn "VLimit" to lineOffset("None",btn "VLimit") end if end menuPick p<55 6 7 8 9 10 20 None cREVGeneralscriptChecksum jB x]3 .c'Q revUniqueID 1115882949347 bookmarks handlerListmenuPick tempScript prevHandlermenuPickscriptSelectionchar 242 to 241scriptW

on menuPick pItem

set the xLimit of fld "MyTable" to pItem

if pItem = "None" then

set the yLimit of fld "MyTable" to pItem

set the label of btn "VLimit" to "None"

set the menuHistory of btn "VLimit" to lineOffset("None",btn "VLimit")

end if

end menuPick

= Label Field  j cREVGeneral revUniqueID 1115882949348 Horizontal: > Tab Menu}on menuPick pNewItem,pOldItem lock screen select empty -- if a cell is being edited hide grp pOldItem show grp pNewItem unlock screen end menuPick ^Action Discussion cREVGeometry Master,expectedRect 20,14,720,620Master,scalebottomDistance-50Master,movevDistancefalseMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,cardRanking1Master,scaleBottomtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneralscriptChecksumAuVr=Y bookmarks revUniqueID 1115730581286 handlerListmenuPickscriptSelection char 88 to 87 prevHandlermenuPick tempScriptscript

on menuPick pNewItem,pOldItem

lock screen

select empty -- if a cell is being edited

hide grp pOldItem

show grp pNewItem

unlock screen

end menuPick

 Discussiona-05 cREVGeneral revUniqueID 1115732666160 Info `14  cREVGeometry Master,expectedRect 46,52,694,576Master,scalebottomDistance-94Master,movevDistancefalseMaster,scaleBottomObjectSideBottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,scaleBottomObjectRefcardMaster,scaleBottomAbsolutetrueMaster,cardRanking1Master,scaleBottomtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneral bookmarks revUniqueID 1115732655934 handlerListscriptSelection char 1 to 0 prevHandler tempScriptscript  #How-To stack #016 by Eric Chatonet @" 5/27/05 Initial release @  Table fields feature is a rough draft and do not work properly in DreamCard/Revolution and then, stay undocumented (v 2.5.1 included at the moment) :-( @ eSo, while waiting all this fixed in a future version, this stack tries to provide for some clues :-) @d V------------------------------------------------------------------------------------- U 1. Getting started  V------------------------------------------------------------------------------------- U  What are table fields? @1600   nA table field displays a tab/tab/return list of values, each value is truncated to fit the width of its cell.   'F @As Excel allows it, you can edit a value by clicking on a cell. Tip: You can create a table file with Microsoft Excel by choosing the Text (separator: tab) format when saving your work within Excel.   How to create a table field @1600    @11120  @11121  WUse the appropriate tool in the palette : watch the tooltips to choose the right tool. In the Basic Properties pane of the property palette, activate the horizontal scrollbar: if you don't, you might not understand anything because the field can be automatically scrolled even though you are not able to watch it!    " The property palette Table pane @1600   HThe Table Object check box allows a field to behave like a table field. >The cRevTable[celledit] check box allows cell editing or not. NSee the EnableCellEditing handler which allows to fix cell editing by script.   4 dShowlines, hGrid, vGrid and tabStops are usual options which work well (check the docs about them).          $? @Cell formatting options stay opaque and do not seem to work :-( ?  The cRevTable property set @1600   yWhen you create a table field, the engine adds a new property set to the custom properties of the field named cRevTable. n n w To see this property set in the property palette, be sure that the View > Revolution UI Elements in Lists menu item is checked.   fThe engine adds up to 25 custom properties to the cRevTable property set as and when they are needed. 2 2 <) cSee these properties in the Action section which are updated on the fly according to your actions. XTo manage correctly table fields, your programming will update some of these properties +(see chapter 2: Working with tables below)   # (The most interesting are the following:  currentxcell current column  currentycell current row  celledit true or false % cellxspacing column width in pixels # cellyspacing row height in pixels 0 currentcellvalue html text of the current cell * currentview html text of the whole table \There are other properties which appear redundant like topfieldloc: the top of the field... 7 7 C :Or do not seem entirely reliable like viewablecolumns :-( & & 5 3 How to fix the columns width and the rows height @1600  0 To fix the columns width, set the tabstops to the appropriate value in pixels in the Table pane of the field property palette. U U Z$ To fix the rows height, first set the textSize in the Text Formatting pane of the field property palette, then display the Basic Properties pane and check again the fixedLineHeight box: it will fix the textHeight according to the textSize. & & . 6 E6 {        HBy script: see the SetTableRowsHeight and SetTableColumsWidth handlers.   % * =  How to add header fields @1600   8In the Action section, the table is made with 4 fields: 5 - A backgroung field for a whole rectangular shape.  3  - A main table field.   8 - 2 fields which display the rows and columns headers.  6 uThe field displaying the columns headers is an ordinary field whose vGrid property is set to true in the Table pane. D D I i n GThe tabstops of this field have to be set as for the main table field.    : eTo populate such a field see the additional PopulateWithLetters function in the script of this card. , , ?% rThe field displaying the rows headers is an ordinary field whose hGrid property is set to true in the Table pane. A A F f k HThe textHeight of this field has to be set as for the main table field.   9 eTo populate such a field see the additional PopulateWithNumbers function in the script of this card. , , ?% LOf course locktext and dontwrap properties are set to true for both fields.     , In order to synchronize the fields, just add a scrollBarDrag handler and a setProp control structure within the script of the main table field: / / < K R=  on scrollBarDrag  @   lock screen  @  6 set the vScroll of fld "Rows" to the vScroll of me  @  @   @( / @3 2 -- Rows is the name of the left vertical field  @hh"". 8 set the hScroll of fld "Header" to the hScroll of me  @  @   @* 1 @5 5 -- Header is the name of the top horizontal field  @hh""1  unlock screen  @   end scrollBarDrag  @  $ ----------------------------------  @hh""" @ setProp cRevTable -- cRevTable is the name of the property set  @  @hh"", 0 scrollBarDrag -- executes the bandler above  @hh""  @hh"" 3 pass cRevTable -- so the properties are updated  @  @hh""  end cRevTable  @  tNote that the engine sends the message scrollBardrag to any field when you change its hScroll or vScroll by script. s The setProp control structure allows to update the scrolls of the fields when the engine updates any property within the cREVTable property set of the field (check the setProp control structure in the docs).    n y &    How to set the grid color @1600   qJust set the Grid/Border color (borderColor) of the field in the Colors & Patterns pane of the property palette.  ) A R  How to set the text color @1600   hJust set the Text color (textColor) of the field in the Colors & Patterns pane of the property palette.   ' 8 I V------------------------------------------------------------------------------------- U 2. Working with tables  V------------------------------------------------------------------------------------- U & How to import a tab/tab/return file @1600  # 3I don't want to discuss here any database feature. ;If you prepared a tab/tab/return file with Excel just use: 1 put url("file:" & tfilePath) into fld "MyTable"  @  @  @  ! How to create a list of values @1600   DThat example shows the principle of creating a tab/tab/return list: oImagine you want to create a 10*10 cells table populated with integers from 1 to 100, just use something like:  repeat with i = 1 to 100  @  put i & tab after tTable  @     6 if i mod 10 = 0 then put cr into char -1 of tTable  @  @ @   @+ , S -- replace the last char (a tab) by a carriage return when i is divisible by 10  @hh""O ) -- check the mod operator in the docs  @hh"" @hh"" @hh"" end repeat  @  @ 1 delete char -1 of tTable -- a supernumerary tab  @  @  @hh""  put tTable into fld "MyTable"  @   How to clear a table @1600   /Clear the text of a table field is not enough: You have also to clean some properties stored in the cRevTable custom property set of the field like currentCellValue and currentview. 5 5 >' e u z  See the ClearTable handler:     ClearTable @ ! How to write a value to a cell @1600   eBy hand: ensure first that the cell editing is active and click onto a cell to display an entry box. +By script: see the WriteCellValue handler:   ! B WriteCellValue ,,, @A OBy script, you can write data to a cell, even if the cell editing is inactive. N " How to read a value from a cell @1600   See the ReadCellValue function:    J put ReadCellValue(,,) into tValue  @8 = $ How to select a cell by scripting @1600  ! See the SelectCell handler:    6 SelectCell ,, @5 *This handler scrolls the field if needed. )  How to master table limits @1600   kBy default, a table has no limits: you can use the arrowkeys or the tabkey to navigate as far as you wish.  Practically, you will often need to display a x*y cells table without scrollbars as a matrix where all cells are visible and let the user navigate in carousel (go from the last cell in a row to the first cell in the next row and so on) through the limits yo have set. `In order to set these limits, you will trigger the keyboard events within a rawKeyDown handler. L L V See the rawKeyDown handler.    oHere the limits which are integers are stored as custom properties named xLimit and yLimit in the table field. I I O T Z Y How to know when a property has been changed by the engine in order to act accordingly @1600  V lThe engine implements automatically the properties in the cRevTable custom property set of the table field. To act when any property has changed, just use a setProp control structure (check the docs about this one) as noted above. Place this control structure in the script of the table field. 1 1 8 Example:  setProp cRevTable  @  _ answer warning "Are you sure that you want to modify this value?" with "Modify" or "Cancel"  @ ; @E J ( if it = "Modify" then pass cRevTable  @  @  @   end cRevTable  @  V------------------------------------------------------------------------------------- U #3. Handlers and functions provided " V------------------------------------------------------------------------------------- U Since the spreadsheet fetaure is not completely reliable at the moment (Rev 2.5.1), I did not want to provide scripting tricks as a library. PHandlers and functions are in the script of the card: they are fully commented. =Click on the Show Handlers button below to open this script. < ClearTable Clear a whole table @   2 EnableCellEditing Enable or disable cell editing  @  2 WriteCellValue Write a value to a specified cell  @ " 0 ReadCellValue() Returns a specified cell value  @  $ SelectCell Select a specified cell  @   ( SetTableRowsHeight Fix the rows height  @  + SetTableColumsWidth Fix the columns width  @  6 rawKeyDown Allows to master user's navigation limits  @  * % SetCurXCell Sets the current column  @   " SetCurYCell Sets the current row  @   / CellLoc() Returns the loc of a specified cell  @  $ And 2 bonus functions: A PopulateWithLetters() Returns a tab delimited list from A to ZZ  @ * C PopulateWithNumbers() Returns a return delimited list of integers  @ , V------------------------------------------------------------------------------------- U 4. Encountered issues  V------------------------------------------------------------------------------------- U Q When editing a cell, you may press the enter key which acts as the return key. @1600 O Once your input validated, only the first line stay into the cell: other values are thrown in the first cells of the next lines according to the number of carriage returns and... replace the possible previous values. A When you edit cells quickly, the values are not always stored. @1600 ? ? Roughly speaking, more issues with Windows than with Macs... @1600 =  `5  Show HandlersEp5on mouseUp edit the script of this cd end mouseUp @Jd cREVGeometry Master,expectedRect320,586,420,609Master,scalebottomDistanceMaster,movevDistance-73Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,moveVObjectRefcardMaster,moveVAbsolutetrueMaster,cardRanking1 Master,moveVtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneralscriptChecksumLfB+s bookmarks revUniqueID 1115732864919 handlerListmouseUpscriptSelection char 40 to 39 prevHandler tempScriptscript

on mouseUp

edit the script of this cd

end mouseUp

#PrintEpAon mouseUp revPrintField the name of field "Info" end mouseUp xJ< cREVGeometry Master,movevDistance-73Master,scalebottomDistanceMaster,expectedRect320,586,420,609Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,moveVObjectRefcardMaster,scalerightDistanceMaster,cardRanking1Master,moveVAbsolutetrue Master,moveVtrueMaster,scaletopDistanceMaster,scaleleftDistance cREVGeneralscriptChecksum4p0G! revUniqueID 1115824545996 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 64 to 63script

on mouseUp

revPrintField the name of field "Info"

end mouseUp

SSS.png  Hon mouseDown revGoUrl "http://www.sosmartsoftware.com" end mouseDown 2v"-PNG  IHDR". pHYs.#.#x?v 9iCCPPhotoshop ICC profilexڝwTTϽwz0z.0. Qf Ml@DEHb!(`HPb0dFJ|yyǽgs{.$O./ 'z8WGбx0Y驾A@$/7z HeOOҬT_lN:K"N3"$F/JPrb[䥟}Qd[Sl1x{#bG\NoX3I[ql2$ 8xtrp/8 pCfq.Knjm͠{r28?.)ɩL^6g,qm"[Z[Z~Q7%" 3R`̊j[~: w!$E}kyhyRm333: }=#vʉe tqX)I)B>== <8Xȉ9yP:8p΍Lg kk Ѐ$t!0V87`ɀ2A. @JPA#h'@8 .: ``a!2D!UH 2 dA>P ECqB**Z:]B=h~L2  5pN:|ó@ QC !H,G6 H9R ]H/r Aw( Q(OTJCm@*QGQ-(j MF+ 6h/*t:].G7Зw7 Xa<1:L1s3bXyeb~19 vGĩp+5qy^ oó|= ?'Htv`Ba3BDxHxE$Չ"XAP44077&9$An0;T2421t.54ld+s;# V]=iY9FgM֚k&=%Ō:nc1gcbcfX.}lGv{c)LŖN퉛w/p+/<j$.$%&㒣OdxTԂԑ4i3|o~C:&S@L u[Uo3C3OfIgwdO|;W-wsz 17jl8c͉̈́3+{%lKWr[ $ llGmnacOkE&EEY׾2⫅;K,KhtiN=e²{^-_V^Oo§s]?TWީrjVQ=w}`嚢zԶiו8>k׍ E  [ly邟~_Y53rW򯎼^{7so}x>|쇊z>yzgAMA|Q cHRMz%u0`:o_F"IDATxbax& O?"?z$<@,X< dz,,2{H?Hk4^B˧̌<4i_rD@,hgaӊb:޾zo]ǷDr8 4y6{5ݕ]WMż#٩ƧoZQqm8$Iyon0w 3+ `8 K d+ ,?ۏҟ]xۥW/~g33+?@S_B9.3_823J{;kc :e'HfCqΈ#{x#Sxs`]Ϛ[^>Y5c+?8r2,FF zh(~(M Ѱ狻v%?d|\>}aeE,^%oΦU{ǃ_Tdگ?w>ytfo <"JYղC"%.686lq-dG &pK\j{H@FeoFWwnAςDE|Փg{Y8~#%̅~f^U8]#50Ln>n^>~f[v6&߰ d cvF>H?~ߟ郹,",Z9}WX%ëXDHĄŠ 9J02qrrﳃ_+yop6E[?;3R.QYy844>?ǛGW50s[s|DYޜs%fq-9_KLu~W=\j^n+!a&lgǯ^ӏ]m rB#ǻ? hV.n6%Lz<х ;'￿ ?g{3蟿~/,r6 ~rOmsy9<9'x9 s-RXxծ|:,>̲ܿ?R= w3< 0 C_>;%'o3_?*imcރ?"2BqN.z6UI/"N~|zʲ/Ho_8AII[9Ԟ|d/O^0Q-$*ۻ= ?:Ű̢*'c*fy_ο> ^Q0si.c``_̒NL l [{p H),x]^ F o1ٍ-w}R0XxkqF_bh6^ . f6F Y. M;S.!IΞz+ *rO3߿z:;;El9%5<{{ˣa!0F6q!qNq M ߿,Oمye-d~82ċsɫ }?R\]WɫJEYDMI\XBV^]$L\ҺJj\6_d x }#ǩB__=r{ 73昳ps0+hڙ7}T~˻oya!!#v</^#.+YXUGN?FSHERTYQHXVDWߞ\RP&-<*e|o:ԹDZO\C7VUAqc㗶ɔ2SRS^!ѕ򊼡r2\vont@W޳2.>eͩ\Pvw׾zY-NݛoM7+Iq+Z( V2{sW/~PvKꙟ(wnZ_V!_xDľTbƯ@I]u &vnn:aAJJ}0-{aQf_>\~A>/x a|x]=҆'?X=ۜ\VqIe̩>[g$\be4 KkabEXOH9 ϟqɍO^-V`ʇ{<~y1I 2sps2 }g,,j2 UWUgWĿ630~}go |mĦ#".$"oϸd⃥>_v>AFN~A&HFLOhpIY PW&У O7., ٲ;|e  ,(|w(㷕 ~ մ6岛6mcC  ŋ"Ogw^z`)PK(B ]SLhُn gyf quc|xw铦-Wfh9Ӌn?zzȅ<U6t5J{ʜ&'O;/?_SģNZƯƐ1D#Ey8rD9*{2hl8zi{᧖UqP$(M[QWc 'Ӆn@ȏ>ov7V9:V Ɇ12 QWB`"EkyщYeWާӝwZ\i+7M4+' 6 7J7tAcV3! abF$Lup!5ӭ4ՠn es=>zZ$g?./}<9YS8RGJRpVܩ-M/)=PXT<_1CWMr!lqy[KIE 1A fzY-3W‘W]d7ۑRVͿ h(Tb 69|yfʖ V&%a&'Jt^c N@JXJԎ0yof6>0S'_!à-c0_cFˮ ¶ 2.5 XjS%-X%ԑ0ꀣÝz]m?^8%g*@̶2)x+[V,$p59'>qdI@%˟x/Ⱥ)e9RJ)sRCbN+$ %\w7[:·mwhMNl'bIг܂:m֐kuF]i.w/_ߞo]e3 p ؂_.b,&kWLZSϯ_nlvӓ~K@LTKT]PRV }xuc&G%+v6FQIUVPqyV<<>~z';;0v..Vf&fv6VfV`A痏RQJEME&X@w2(9XW.wLrjɲ&(A[հxUe||RZ*)b< D.N`Q+,'ۤ ԳQxɗ<~}i]`b'lg54`g|}ƉOOE.FB XKl ɻuVGDTT`}yBXvRbgW1P燔vx4v  _vM{Dun` `C73\&vU+_R^;LJן_]>[DLk~5+RigvYJQˏ[̎ZN32;?߿???ٝ;?>|sbҒڞR?>~x!*h/|&xwoJDX̎[cƒ+_ X'*fZ+k”WCּs Ý _=l>$ٹ#WTOGOGp[`0W'=?Ǡw\"zi+'Z{7Μ r7/_ZAˋfeTxoW@Ps&on?MM(WT ֥y E 6!ßon7?ҿ?>zr[ Ƿ7?y򆘦<^\۽bꅅ Wuov>ZBݩ>SV'_]:2@W_?6Zd~|t󯰲S_:w5w~O_7;GL7H^츹kfamo>xtv!޳+O=`F`]7^\9xɉ-o8ee~¯oo iWԿ=4!MU3A~1?@KOa}`~H/7737?>o(2A_?{u'>7 `==Wpi}dϧ'v.Ⱦ2Y^<ӇXyy~~{'6~u+h ë >q^!eV w2{*wξ ?pf/+po?>+a%,-G!xs{ UziN:Lȉj?bFbFZ`X!C_5 lfUHv#H{ y*ϊa-Xc \|(:mJ[}pwwK\ӻ^7#`@jE f{&0HaOeR^b:"8r G#Rτ%P>-Z[XhWCC VAGL[X _DGY36ؘs`AX@z?6e_4B+LI=88hY X"=G1"978H3X˄ ۦ { nfh !l8t~C)yyޞoՙoo-Hu,k-Te5ʈfFK\{Hpehu?" GDÆGZK'h?D⡕B>,,7ug'H= `ı} /Q@60,lk1'!l"F?M!H \2nha?h"?͈+#Ă'?[BX?Z'$V} e@)ii@:TZVJ@, \͌o'zM[{@D}3<bhT``4Ӥ(IENDB` cREVGeometry Master,expectedRect306,630,434,664Master,scalebottomDistanceMaster,movevDistance-23Master,moveVObjectSidebottomMaster,movehDistancefalseMastertrueMaster,scalerightDistanceMaster,moveVObjectRefcardMaster,moveVAbsolutetrueMaster,cardRanking1 Master,moveVtrueMaster,scaleleftDistanceMaster,scaletopDistance cREVGeneralscriptChecksum`}^.e revUniqueID 1115732766035 bookmarks handlerList mouseDown tempScript prevHandlerscriptSelection char 13 to 12script

on mouseDown

revGoUrl "http://www.sosmartsoftware.com"

end mouseDown

@ Flche2.png h PNG  IHDR Kpl_ pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb?,Xv$ϯ.?~~e'P#@11 @?~23_k_?V@p /÷>|()%ţ,%-F2\@ *n w JU牓/_ o_ū(II` b`AM]Nk5 _ ,?d+@021~K?@fӬ ~W XXY};w<||| ߿}Kw^W@koǑ74;Gڷo_߿uLL7qe`&Fqϟ_sPuFFfbA8`(10r=zk~ TxNP`=l|,IENDB` cREVGeneral revUniqueID 1115733056268+pAll-Palettes_61.png @4&=PNG  IHDR&MsgAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATxb?`Ă̩`FFF `ǥdMMMpMM6Rso޼?߾}>[Q XC 0@>(={̌U-@=ĘӸ"@1"͛7͢ʾDYf""" tKg2] @,蚁8-vûWx% $ӌ'N0ƍ _332h`U @,DGVeG;ϟ?ٽ K : ]2b 1PN| N z6 ?"+ 4 ́o>002 32< y0`Aie???/'3G|-Ï_L ,,ljV5D4K6SN;j֬YМ U,w677˴o`1lkT2ϟ -߿j@Ε8Xo/vIENDB` cREVGeneral revUniqueID 1116584744192+qAll-Palettes_63.png @ &,PNG  IHDR&MsgAMAOX2tEXtSoftwareAdobe ImageReadyqe<IDATxb?`Ăik@]ِc d<,b 12?a_ CQ @, Sj͛|}}ZOͧ/^gd?_~/ZbgTFf/^1̞;  P @tu#жk70ݸA@a /_0c \с/lj@ _Y]=_(pbO?dcdax7"Q C-@%: z ,NE9C-@3t3333  C-@0b@VD/2 Xha1ďPOIZ̈] Dr ;C(\mA6i +A_ ?V T He 03>zk =de.\y ̍YW]09}a߾ ||< ?}eprF'3͞,Ûw<D~l=W!&6ǷXXo_jN9baeW`;XY3b6a