Blank Line from List

Boxcutter

Client
Регистрация
08.06.2012
Сообщения
127
Благодарностей
72
Баллы
28
Hey guys in my template I want to get a line from a list but if the list is blank it spits out a debug error. Now obviously I know the list is blank but as the template runs it will fill up with data automatically. I have a logical if in place to check if the list is empty and if so it uses data from another list until new data has been added to the blank one and from then on it uses both.

Why won't PM just let me run it, pull in nothing from the list and use the logical if to check if it is blank myself? Please note this list will always be blank until it runs in ZP and it makes no sense to add something to the list to get around this.

Thanks
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
it is all up to you and how you drive data into list...
If you check short video i have added today, you will see that zenno have no problem with empty list if you tell it that you are going to drive something to it.

So my guess would be that you have done something wrong there ;-)
 

Boxcutter

Client
Регистрация
08.06.2012
Сообщения
127
Благодарностей
72
Баллы
28
I've looked through your tutorial but I don't see how it covers what I am doing here. I understand that you are pulling in file paths in your tutorial and using get line to get one of those paths etc but in this case my list is a simple .txt file with nothing in it. When I use get line it gives me a error.

Edit: Found one of the problems now I think. The list name I was using was 'Web 2.0 URLs'. Even if I have a url
in the list and I use that list name I get a error 'Sequence contains no matching element'. Learnt something new there.

I changed it to 'Web 20 URLs' and it finds the list url fine now. My problem still stands though because if I have no data in
the list .txt file it gives me a different error 'Index was outside the bounds of the array.'

Here is test template demonstrating this:

http://www.mediafire.com/?y6rc8vdfxff0w40
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
Well.. when you have 0 lines in a txt file you will get this error

No lines = error. )
 

Boxcutter

Client
Регистрация
08.06.2012
Сообщения
127
Благодарностей
72
Баллы
28
Well yes that is my problem rostonix...Whats the error exactly? It knows that I am correctly pulling from a file so why should
it force me to have data in it?

As I said the file will fill up with URLs as ZP runs but to begin with it is empty. Does not make any sense to me at all.
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
It was this way before in V3 and it is same way in V4, empty folder will couse error... that is if you dont do little work around

You didnt get my point before, i told you that you need to tell it that you are going to drive something in.

So all you need to do in here is turning your logic bit around. You need to check if list is empty first, in case yes go to site, in case no get line...and all will work fine. :-)
 

Boxcutter

Client
Регистрация
08.06.2012
Сообщения
127
Благодарностей
72
Баллы
28
I did some thinking and finally what you were saying clicked. What I did was read the file first, save the
result to a variable and then check if that was empty. If it's not empty then a get a line from it otherwise
I use use a different list. Works great. Thanks for your help with this one!
 

drvosjeca

Client
Регистрация
26.10.2011
Сообщения
512
Благодарностей
455
Баллы
63
like i said, there is always way around...

Im glad it is working for you now ;-)
 
  • Спасибо
Реакции: Boxcutter

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)