diff options
author | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
---|---|---|
committer | Siddhesh Wani | 2015-05-25 14:46:31 +0530 |
commit | 6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26 (patch) | |
tree | 1b7bd89fdcfd01715713d8a15db471dc75a96bbf /2.3-1/macros/SymbolTable/ST_Del.sci | |
download | Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.gz Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.tar.bz2 Scilab2C-6a320264c2de3d6dd8cc1d1327b3c30df4c8cb26.zip |
Original Version
Diffstat (limited to '2.3-1/macros/SymbolTable/ST_Del.sci')
-rw-r--r-- | 2.3-1/macros/SymbolTable/ST_Del.sci | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/2.3-1/macros/SymbolTable/ST_Del.sci b/2.3-1/macros/SymbolTable/ST_Del.sci new file mode 100644 index 00000000..7eda874d --- /dev/null +++ b/2.3-1/macros/SymbolTable/ST_Del.sci @@ -0,0 +1,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
|