Plugin access to arrays?

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,460
88
Albuquerque, NM
prospero.unm.edu
HELP PLUGINS says:
ArrayVariables

Plugins can access TCC array variables directly through the ArrayVariables array. See TakeCmd.h in the SDK for details.

but I have not been able to find a copy of TakeCmd.h which documents this interface. I vaguely remember seeing a synopsis at one point, and being deeply confused by it. Let me know if you figure it out....
 
May 20, 2008
11,400
99
Syracuse, NY, USA
HELP PLUGINS says:


but I have not been able to find a copy of TakeCmd.h which documents this interface. I vaguely remember seeing a synopsis at one point, and being deeply confused by it. Let me know if you figure it out....
I was aware of the existence of that array (or at least a function to get a pointer to it). TakeCmd.dll has
Code:
g:\tc24> undecorate ?ArrayVariables@@3PAUARRAYS@@A
struct ARRAYS * ArrayVariables
but it's not documented and I have no clue what the struct may look like. I was hoping for ways to manipulate array entries. If the array of structs gives pointers to the arrays and the arrays are like "C" arrays, that would be good enough. If they're not like "C" arrays, we'd need some functions.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
I figured out a little. This much (the name) works (32-bit version).
Code:
struct ARRAY
{
    LPWSTR szName;
    BYTE bytes[64];    
};

    ARRAY *Arrays = (ARRAY*) GetProcAddress(global.hTCDLL, "?ArrayVariables@@3PAUARRAYS@@A");
    Sprintf(szExpr, L"SETARRAY array_name[3,4,5,6]");
    Command(szExpr, 0);
    Sprintf(szExpr, L"SET array_name[0,0,0,0]=666");
    Command(szExpr, 0);
    Printf(L"Address of name: 0x%lX\r\n", Arrays[0].szName);
    Printf(L"ArrayName = %s\r\n", Arrays[0].szName);

Output:
Code:
Address of name: 0x1C36B48
ArrayName = array_name

I can't make a lot of sense out of the next 64 bytes. I see the 4 sizes there (though the last one looks different from the first three), There doesn't seerm to be a number of dimensions or a pointer to the beginning of the array.
Code:
    for ( INT i=0; i<64;i++ )
        Printf(L"%d ", Arrays[0].bytes[i]);

Output:
Code:
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 152 121 196 1
 
May 20, 2008
11,400
99
Syracuse, NY, USA
This was the 64 bytes following the name pointer for a 3x4x5x6 array.

Code:
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 152 121 196 1

Here are the 64 bytes following the name pointer for a 3x4x5 array.

Code:
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 8 121 118 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

It doesn't even look like the same kind of struct. I give up.
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly 64-bit Plugin development using PureBasic Plugins 15
R New Plugin Plugins 0
Alpengreis elevated plugin questions Plugins 3
fpefpe utf-8 support in sdk/plugin api Plugins 4
S How to? Can @DU function in 4Utils64 plugin somehow cater for dirs with spaces? Plugins 3
vefatica How big is a plugin's parameter buffer? Plugins 5
C @knownpath plugin Plugins 0
Charles Dye Updated OSD plugin Plugins 0
Joe Caverly C# plugin framework for JPSoft's TCC Plugins 0
dcantor Help for newest version of TEXTUTILS plugin Plugins 10
dcantor UISTUFF plugin missing help topic Plugins 12
M How to? Use SafeChars plugin... Plugins 2
dcantor Error in SAFECHARS plugin v 1.9.0 Plugins 2
dcantor Request for documentation for ISO8601 plugin Plugins 4
vefatica Possible with a plugin? Plugins 6
dcantor Inconsistency between textutils plugin and wrap utility Plugins 2
M (Stupid?) Problem with 64-bit 4Utils plugin... Plugins 3
H Latest ISO8601 plugin? Plugins 1
Charles Dye New plugin: QKeys Plugins 34
S Plugin to quickly locate all files hard linked together Plugins 5
S Documentation Plugin everything.dll Plugins 5
newbie How to? Multi-plugin installation errors, Re: FedUtils8 Plugins 7
vefatica Plugin -> thread -> Command() -> Ctrl-C? Plugins 20
Charles Dye A weirdoid plugin question Plugins 6
M SafeChars plugin misbehaving... Plugins 3
M A weird error re a plugin... Plugins 0
vefatica Plugin dilemma Plugins 2
fpefpe Documentation Plugin API/SDK Plugins 3
C Looking for Vince's old 4UTILS plugin for TCMD v8 Plugins 1
S DESKTOP plugin - anyone ? Plugins 0
C How to? a plugin to sort Outlook Express "rules" Plugins 0
M ISO Plugin: Yes, it's wonderful, but it could be yet more wonderful... Plugins 7
M The ISO plugin is wonderful, but it lacks a little something... Plugins 22
Charles Dye Beta plugin: HidePasswords Plugins 3
M ISO8601 Plugin not "reporting" errors to TCC... Plugins 4
Frank 4console plugin Plugins 4
S WAD ISO8601 Plugin Plugins 15
Joe Caverly Plugin and 64-bit TCC Plugins 3
C Problem with FixNames plugin Plugins 9
dcantor Suggestion and request for DBF plugin Plugins 6
dcantor Suggestion for SafeChars plugin Plugins 7
M Charles, I just installed the "new" SafeChars plugin, ... Plugins 5
M A problem with the SafeChars Plugin... Plugins 30
S WHICHWIN (sysutils plugin) Plugins 13
M A (presumbly pretty simple) SafeChars plugin request... Plugins 2
M A "SafeChars" plugin request... Plugins 2
S ISO 8601 plugin enhancement Plugins 6
D UNKNOWN_CMD in Plugin Plugins 13
C Looking for isemailaddress[string] plugin Plugins 7
S ISO8601 Plugin Plugins 4

Similar threads