[V4MD] pointer at the same table by binary_link

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Sep 13 00:21:21 CDT 2005


On 9/12/05 11:03 PM, "info at vallemediatime.com" <info at vallemediatime.com>
wrote:

>> What exactly problem is ?
> 
> Difficult to tell you Ruslan,
> e.g. look at this simple script,
> I've checked all the variables and these are good,
> but when I use addLink with the first gLinkName all works fine, if I change
> the
> gLinkName and other variables, the getLinkCount dont' work and nothing
> happens, because
> the line:
> count = link.countLinked(i, gTab_A, gTab_B)
> return me always 0
> 
> on addLink
> link = gDb.link(gLinkName)
> a = gDB.table(gTableName).RecID
> b = value(member("Tab_B_ID").text)
> link.linkRecords(a, b)
> getLinkCount
> end
> 
> on getLinkCount
> link = gTab_B.link(1)
> recCount = gTab_B.recordCount
> counter = 0
> repeat with i = 1 to recCount
> count = link.countLinked(i,  gTab_A, gTab_B)
> counter = counter + count
> end repeat
> member("dLinkCount").text = string(counter)
> end

Another note.

I see that you use intensively the global variables.
This is danger.

better

----------------
on addLink( inKinkName, inTableName )

  link = gDb.link( inLinkName )

  a = gDB.table( inTableName ).RecID
  b = value( member( "Tab_B_ID" ).text )
 
  link.linkRecords(a, b)
  getLinkCount

end
----------------

Better because it is more flexible and more safe



-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list