PDA

View Full Version : Losing Table IDs


Unregistered
November 4, 2002, 11:25:44
Hi TX,

TX9sp6, VB6sp5, W2Ksp3

I am assigning tables with fixed ID's, starting from 10 and incrementing upwards.
I build a table in the background in one TX control, fill the cells with data, etc.

I then populate my visible TX control with the contents of the hidden one.
All the content is moved across with no problems except the table ID changes.

In the TX documentation we have to use table ID's 10 to 32,767.
But, in the visible control the tables now have a negative number and seem to start at minus 32,766.

Can you confirm this and why are the ID's not being remembered.

Thanks,
Carl


This message was originally posted by Carl Radley in the old TX Text Control Support Forum.

Björn Meyer
November 4, 2002, 18:36:58
Hello Carl

How many tables do you insert and are you sure that you assign your own table id by creating the tables?

Björn Meyer, TX Text Control


This message was originally posted by Björn Meyer in the old TX Text Control Support Forum.

Unregistered
November 5, 2002, 15:35:17
Negative table ID's are the ones generated by the TX itself. What you could do is a save of the control to a database field and read that into another TX control. That will keep the table ID's as you have initially set them

r. Mikko


This message was originally posted by Mikko in the old TX Text Control Support Forum.

Unregistered
November 6, 2002, 09:46:48
All my table IDs are CONST, starting at 10 and currently goes up to 70 (not all get used at the same time though).

The moving of contents works fine.
The table is created in one TX control and contents are moved to another TX control.


Here is an example (in VB6) of my table creation
[txConfigure] is the hidden TX control
[UploadText] is a procedure for moving the contents of [txConfigure]
[ctlEditor] is a different usercontrol that holds the visible TX control [txView]
is a procedure within [ctlEditor]


--Start of Code--
Private Const TABLE_FM_PRODUCTLINK As Long = 62


With txConfigure
.ResetContents

If Not clsProdLinks Is Nothing Then
intRows = clsProdLinks.Count
If intRows > 0 Then

intErr = .TableInsert(intRows + 1, 4, -1, TABLE_FM_PRODUCTLINK)

.TableCellText(TABLE_FM_PRODUCTLINK, 1, 1) = "Product"
.TableCellText(TABLE_FM_PRODUCTLINK, 1, 2) = "Type"
.TableCellText(TABLE_FM_PRODUCTLINK, 1, 3) = "Company"
.TableCellText(TABLE_FM_PRODUCTLINK, 1, 4) = "Contract"

For intLoop = 1 To intRows
.TableCellText(TABLE_FM_PRODUCTLINK, (intLoop + 1), 1) = clsProdLinks.Item(intLoop).Product
.TableCellText(TABLE_FM_PRODUCTLINK, (intLoop + 1), 2) = clsProdLinks.Item(intLoop).Basis
.TableCellText(TABLE_FM_PRODUCTLINK, (intLoop + 1), 3) = clsProdLinks.Item(intLoop).Company
.TableCellText(TABLE_FM_PRODUCTLINK, (intLoop + 1), 4) = clsProdLinks.Item(intLoop).Contract
Next intLoop

UploadText

End If
End With
--End of code--

--Start of Code (UploadText)--
Dim rtfText As String

With txConfigure
rtfText = .SaveToMemoryBuffer(rtfText, 5, True)
ctlEditor.ImportRTF rtfText

.ResetContents
rtfText = ""
End With
--End of Code--

--Start of Code (ctlEditor.ImportRTF)--
Dim bytLocal() As Byte

bytLocal = StrConv(strRTF, vbFromUnicode)
txView.LoadFromMemory bytLocal, 5, True

Erase bytLocal

--End of Code--


[I]This message was originally posted by Carl Radley in the old TX Text Control Support Forum.