Register to post in forums, or Log in to your existing account
 

This forum is locked: you cannot post, reply to, or edit topics.  This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sun Aug 21, 2005 6:57 pm   

FindFiles doesn't?
 
I don't seem to be able to get FindFiles to return anything..

Code:

<?xml version='1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE zapp [
  <!ENTITY AppTitle "zApp Demo: Widgets">
  <!ENTITY AppAuthor "Jess Robinson">
  <!ENTITY AppVersion "1.0">
  <!ENTITY AppURL "">
  <!ENTITY AppImage "ZAPP">
  ]>
<zapp>
  <head/>
  <mainwindow>mainwin</mainwindow>
  <window name='mainwin' caption='zApp Files' width='640' height='480'>
    <panel name='mainview' align='client'>
      <list name='filelist' align='bottom' />
      <button caption='Test Me' align='top'>
        <script language='PerlScript'>
           <![CDATA[
             $core->MsgBox($file->CurrentDir);
             my $fdir = $file->FindFiles('*.*');
#             $core->MsgBox(Dumper($fdir));
             for f (in $fdir)
             {
                $core->MsgBox($f);
             }
           ]]>
        </script>
      </button>
    </panel>
  </window>
</zapp>


Outputs the current dir, which has various .zml and other files in, but FindFiles seems to return an empty collection, and the loop does nothing.

I can't figure out how to output CurrentDir in VB, so I left this in PerlScript..

Lady C.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Aug 22, 2005 4:10 pm   
 
Yeah, something seems to be messed up with the File record. The FindFiles seems to work fine. If you look at $fdir->count for example, you should get the number of files in the directory.

Here is the test code that I've used to test FindFiles in the past:
Code:
  <panel name='form' align='client' color='=color.value'>
    <grid name='Grid' Align='client'>
      <column Caption='FileName'/>
      <column name='AttrCol' Caption='Attr' Kind='Image' Mask='16' ImageList='|Folder' HeaderImage='Folder'/>
      <column name='SizeCol' Caption='Size'/>
      <column Caption='Modified' Field='ModifyTime'/>
    </grid> 
  </panel>
  <script>
    Set Files = file.findfiles( "*.*")
    Grid.Collection = Files
  </script>

This code properly fills the grid with the files collection. But when I tried to do this:
Code:
Set Files = file.findfiles( "*.*")
for each f in Files
  msgbox f.filename
next

it didn't work. Perhaps there is a new bug related to using the "for...each" construct with collections in zApp? I know this used to work, but something has broken it in the recent version it seems.

Oh, and the VB syntax for getting the CurrentDir would be:

code.MsgBox( file.CurrentDir)

Basically, in converting Perl to VB you replace -> with a . and get rid of the $ characters. And instead of using "my" you use "set", and instead of single-quotes for strings, you use double-quotes.

In any case, this looks like another bug that I need to track down soon, so thanks for the report.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Tue Aug 23, 2005 6:32 am   
 
Hmm.. What I did to find out whether it returned anything was to "Dump" the $fdir object, when creating my own Collections, this shows me the entire contents of the Text field, separated by whatever separator was chosen. When dumping $fdir however, the Text field was empty, and I think the count one was too, but I'm not sure.

I can't test right now as I need to take down all the machines and move them across continents ,) (And my zApp trial runs out on Saturday, so we'll have to see when I can afford it to carry on :)

I could swear I tried core.MsgBox (file.CurrentDir) ..

Lady C.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Aug 23, 2005 4:24 pm   
 
Moving across continents? Wow, where are you headed?

I apologize for the poor timing of all of this. You'll see a lot more active work when I get this shopping cart and new copy protection stuff up and running. It's certainly taking a lot longer than I planned (as always I guess). After doing some testing yesterday I ended up with 3 pages of stuff that needs to be "tweaked" or fixed.

Once the shopping system is ready and I've got eLicense replaced with Armadillo, then I'll be able to give much quicker response on problems like this and get back to the weekly builds.

It's unfortunate that this doesn't fit better with your schedule, but I hope you come back after the move and continue to play with zApp. Your trial will end up getting reset when we switch to Armadillo, so maybe that will help. I'd *really* like to get zApp working well for Perl users, and you are about the only one around here testing the Perl stuff.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Tue Aug 23, 2005 6:39 pm   
 
Well, across the continent anyway.. From south Germany back to the UK.. (oof)

Yup, I realised its hard to do active work on one thing, and then answer questions about another.. As long as you get around to looking at/fixing the bugs I've been finding.. (And adding that Canvas component!)

I actually just started attempting a little app, so hopefully the second round of the trial will see me through, and after that first month of working in the UK, I'll be able to buy it (on my birthday list too.. hehe)

What I've been fiddling with so far has been a demo app that attempts to show each of the visual components. (By cheating and copying the examples from the Perl/Tk toolkit thingy..) Hopefully that'll be of use to you as a demo.

Back next month, I hope!

Lady C.
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Tue Aug 23, 2005 6:39 pm   
 
Well, across the continent anyway.. From south Germany back to the UK.. (oof)

Yup, I realised its hard to do active work on one thing, and then answer questions about another.. As long as you get around to looking at/fixing the bugs I've been finding.. (And adding that Canvas component!)

I actually just started attempting a little app, so hopefully the second round of the trial will see me through, and after that first month of working in the UK, I'll be able to buy it (on my birthday list too.. hehe)

What I've been fiddling with so far has been a demo app that attempts to show each of the visual components. (By cheating and copying the examples from the Perl/Tk toolkit thingy..) Hopefully that'll be of use to you as a demo.

Back next month, I hope!

Lady C.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Fri Aug 26, 2005 12:57 pm   
 
Back to the UK, excellent another Guru here, where will you be, I'm in York (well near in a little town called Pocklington).

Armadillo, there used to be a funny advert on UK tv with that word, it sounds interesting, I'm going to search the forums for more info.
_________________
Taz :)
Reply with quote
Castaway
GURU


Joined: 10 Oct 2000
Posts: 793
Location: Swindon, England

PostPosted: Sat Sep 03, 2005 12:40 pm   
 
Hey Taz,

We're in Abingdon, Oxfordshire now (just south of Oxford).. Still on dial-up at the moment, waiting for Demon to get us organised for DSL.

Lady C.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 29, 2005 8:52 pm   
 
I found the problem with using FOR EACH with zApp Collections. It's fixed for the next 2.33 version of zApp.
Reply with quote
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Home » Forums » General zApp Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
© 2009 Zugg Software. Hosted on Wolfpaw.net