summaryrefslogtreecommitdiff
path: root/2.3-1/macros/SymbolTable/ST_Del.sci
blob: 7eda874d3c1d0f3d86cb431463a3e7dc5a5bd690 (plain)
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
function ST_Del(TBName,SymbolTableFileName)
// function ST_Del(TBName,SymbolTableFileName)
// -----------------------------------------------------------------
// Delete function for the symbol table.
//
// Input data:
// //NUT: add description here
//
// Output data:
// //NUT: add description here
//
// Status:
// 26-Oct-2007 -- Raffaele Nutricato: Author.
// 26-Oct-2007 -- Alberto Morea: Test Ok.
//
// Copyright 2007 Raffaele Nutricato & Alberto Morea.
// Contact: raffaele.nutricato@tiscali.it
// -----------------------------------------------------------------

// ------------------------------
// --- Check input arguments. ---
// ------------------------------
SCI2CNInArgCheck(argn(2),2,2);

// --- Load symbol table. ---
SCI2CSymbolTable = ST_Load(SymbolTableFileName);

// --- Find symbol position. ---
[TBFlagfound,TBPosition] = ST_FindPos(TBName,SymbolTableFileName);

if (TBFlagfound == 0)
   error(9999, 'Missing symbol: trying to del a non existing symbol ""'+TBName+'"".');
elseif (TBFlagfound == 1)
   // --- Update symbol table. ---
   SCI2CSymbolTable(TBPosition) = [];
   
   // --- Save symbol table. ---
   ST_Save(SymbolTableFileName,SCI2CSymbolTable);
end

endfunction