[NTLK] export FilePad to QFig Pro

From: Jaime Méndez (servafin_at_prodigy.net.mx)
Date: Tue Oct 12 2004 - 17:03:47 PDT


Here is a useful script for FilePad ussers.
It exports any entry in your cabinet to Quick Figure Pro.
You can have keys as your dataBase delimiters. Any text or number can be a
key.
Since you can write scrips in the text file editor, The possibilities in
FilePad are almost endless. One thing that can't be done is to execute this
particular code from FieldPad because it won't allow you to open other
applications like QFig.
FilePad is much better than NewtDB. It is a real relational DB, entries can
be modified, entries can be text, numbers, dates, etc. you can certanly
sort, do estadistical calculations and more. It is more elegant, it's free.
You just have to know how to manipulate soup entries in Newton Script and
have in mind that somthing has to be sent at the end of the script, even a
"" (nil text) would work.
Interested? just e-mail me an i would send you sample codes.

This code is for dashBoard only because it has to call QFig in order to
export data to a workSheet.
If you don't have DashBoard this code can be modified in order to be
executed from a Quick Figure work sheet cell.

bugs free, it will tell you if a cabinet, entry or a key aren't found. It
won't perform any change to your DB or any soup entry not releated to QFig
Pro workSheet entries.
It's safe!

Jaime Méndez
(sorry for my writing)

local i:=0;
local j:=0;
local k:=0;
local b:=0;
local b1:=0;
if Not visible(getRoot().|qfig:donv|) then
getRoot().|qfig:donv|:open();
base:=:DashBoardDoDialog('string,"Cabinet?","Export to QFig
Pro",nil,"Cancel","Continue");
if base = nil then return;
mySoup := getUnionSoupAlways(base&".frm");
myCur:=mySoup:query({indexPath:'_uniqueID});
myCur:Reset();
n:=myCur:CountEntries();
myEntry:=myCur:Entry();
if not isSoupEntry(myEntry) then
begin
modalConfirm(base&&"doesn't exist!",["X"]);
return;
end;
name:=:DashBoardDoDialog('string,"Entry?", "Export to QFig Pro"
,nil,"Cancel","Continue");
if base = nil then return;
refi:=:DashBoardDoDialog('string,"Begin key?

*any entry data in your cabinet as an index reference to start whith",
"Export to QFig Pro" ,nil,"No key","Use key");
reff:=:DashBoardDoDialog('string,"End key?

*any entry data in your cabinet as an index reference to end whith", "Export
to QFig Pro" ,nil,"No key","Use key");
repeat
if k=n then
begin
modalConfirm(name&&"doesn't exist!",["X"]);
return;
end;
regname:= myEntry.FieldName;
reg:= myEntry.FieldNumber;
myCur:Next();
myEntry:=myCur:Entry();
k:=k+1;
until strEqual(regname,name);
mySoup := getUnionSoupAlways(base);
myCur:=mySoup:query({indexPath:'_uniqueID});
myCur:Reset();
n:=myCur:CountEntries();
myEntry:=myCur:Entry();
getRoot().|qfig:donv|:newSheetScript(nil,nil);
ddxFrom:=getRoot().|qfig:donv|;
repeat
j:=j+1;
foreach item, value in myEntry do
if strEqual(item&"",reg) then campo:=value;
if refi <> nil then
foreach item, value in myEntry do
if strEqual(value&"",refi) then b:=1;
if refi = nil then b:=1;
if reff <> nil then
foreach item, value in myEntry do
if strEqual(value&"",reff) then b1:=1;
if b = 1 then
if Not strEqual(campo,"") then
begin
i:=i+1;
ddxFrom:selectRange("a"&numberstr(i)&":"&"a"&numberstr(i));
celda:=ddxFrom:getCurrCell();
celda:= intern(celda[0]);
ddxFrom:parseEntry(campo,celda);
end;
myCur:Next();
myEntry:=myCur:Entry();
until b1 = 1 or j = n;
if b = 0 then
begin
getRoot().|qfig:donv|:close();
modalConfirm(refi&&"doesn't exist!",["X"]);
return;
end;
ddxFrom:addCell(campo,celda);
ddxFrom:selectRange("a1:a"&numberstr(i));

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Mon Oct 18 2004 - 20:00:01 PDT