PDA

View Full Version : Find the fault and win a $100


jassing
10-01-2009, 06:05 PM
Seriously...
here's the deal: I have a long time client that is reporting that my code is 'storing the results'. I cannot see a problem with the code. So, enter my post; find "the fault" and I'll pay you $100. (yes, United States dollars)

Here's the background.
If any of a "certain set" of files is missing from a specific folder, the install should report what file(s) are missing, and then refuse to continue.

My client reported that a file (SYS_FUN_03_SQLTABS_.003) was missing. He copied the file to the proper directory, and re-ran the install; but the install still reported the file as missing.

Here is the code from a listbox screen's "on preload"

local tFiles = {"Actions.003","AdMEN.003","Admin.003","AdREP.003","BioCHECK.003","Classes.003","DAL.003","Guardian.003","IMPORT.003","Join.003","LAPrint.003","Purpose.003","SchCkIN.003","SORHits.003","Students.003","SYS_FUN_02_SQLINP_.003","SYS_FUN_03_SQLTABS_.003" ,"Teachers.003","Vendor.003","Voluntrs.003"};
local x;

StatusDlg.Show();
StatusDlg.SetTitle(SessionVar.Expand("%ProductName%"))
StatusDlg.SetMessage("Please wait...")
StatusDlg.ShowProgressMeter(true);
StatusDlg.SetMeterRange(0,Table.Count(tFiles) )

for x=1,Table.Count(tFiles) do
local cFile = _ProgramFilesFolder.."\\SchCkIn\\"..tFiles[x];
StatusDlg.SetMeterPos(x);
StatusDlg.SetStatusText(tFiles[x])
if not File.DoesExist(cFile) then
DlgListBox.AddItem(CTRL_LIST_BOX, tFiles[x]);
end
end
StatusDlg.Hide();

if DlgListBox.GetCount(CTRL_LIST_BOX) < 1 then
Screen.Skip();
end


Any other errors, than a reason why it would report this file (and only this one file) as "still missing" will not win the $100 -- but will spank me into feeling pathetic and miserable.

-josh

PS: Only the 1st "fault finding" post will get the $ -- so don't just copy someone's answer thinking I'm gonna pay out over and over ;-)

Ulrich
10-01-2009, 07:34 PM
I have to ask... the string "SYS_FUN_03_SQLTABS_.003" is not, by any chance, defined as a default item of the List Box in the screen properties? I don't see you cleaning the List Box explicitly, so it would show something that was defined in the properties.

What does Screen.Skip() do? Is this just another name for Screen.Next() or does it use the List Box in some way?

A look at the project file would certainly help...

jassing
10-01-2009, 07:44 PM
I have to ask... the string "SYS_FUN_03_SQLTABS_.003" is not, by any chance, defined as a default item of the List Box in the screen properties?

EXCELLENT guess, but no, the screen list item is empty on entry.

I don't see you cleaning the List Box explicitly, so it would show something that was defined in the properties.

Good idea, but the box is empty to begin with. There is no choice but to cancel the install if the user ends up on this screen. That was my 1st thought -- that they installed, got the screen, dropped the file in place, clicked "back" and "next" to "reload" the screen -- but they can't -- as back is disabled...

[QUOTE=Ulrich;144341]What does Screen.Skip() do? Is this just another name for Screen.Next() or does it use the List Box in some way?

Screen.Skip() "skips" that screen and goes to the next one -- kind of like .Next only it works both ways (forward/back) Solves a problem that I think those that moved from sf6 forward felt was more of an issue.

See this post (http://www.indigorose.com/forums/showpost.php?p=83461&postcount=4).

A look at the project file would certainly help...

If you want it; it's ugly. But that's the sum total of the code for that screen. the rest of the project will just muddy the waters.


FWIW: Here's my copy of "ConditionalScreens.lua" (Maybe someone will make it into a plugin and claim it as their own work;-))


-- Laslie Toth
-- SF7 forums: http://www.indigorose.com/forums/showpost.php?p=83461&postcount=4
-- expand the screen table with direction tag
Screen.Direction = 1;

-- my back screen function
function Screen.GoBack()
-- go to back screen
Screen.Direction = -1;
Screen.Back();
end

-- my next screen function
function Screen.GoNext()
-- go to next screen
Screen.Direction = 1;
Screen.Next();
end

-- skip screen function
function Screen.Skip()
if Screen.Direction < 0 then
Screen.GoBack();
elseif Screen.Direction > 0 then
Screen.GoNext();
end
end

jassing
10-01-2009, 08:02 PM
Thanks to all (8) for looking, and to Ulrich for playing along. Sadly, today we have no winner.

2 days into this problem, and countless back and forths, and just a notch south of calling me a liar ("You must be storing the results"), turns out my client did not give me the proper file names. the file name is actually
"SYS_FUN_03_SQLTABS_ .003"
or for the font challenged: "SYS_FUN_03_SQLTABS_<SPACE>.003"

This was actually a good experiment... This could save me countless hours in the future, I may re-initiate a similar game.. ;)

-josh