Testing for flight plans, hop lists

Started by PeterR, September 22, 2003, 10:27:36 PM

Previous topic - Next topic

PeterR

Hi Russell,

I'm currently using the following to test if no one is connected to the server:

^^BEGIN_IF(num_pilots,=,0)^^
      ^^BEGIN_IF(num_observers,=,0)^^
                  <!-- Do whatever -->
      ^^END_IF^^
^^END_IF^^

What's the best way to know that there aren't any flight plans filed? I don't see an obvious variable to check so I didn't want to assume any particular side effect for the task.

I'd also like to test when the hop completed list is empty. Is ^^row_num^^ safe to use for this purpose?

Thanks!
Peter
Bush Flying Unlimited
"At home in the wild"

Russell Gilbert

#1
For Flight Plans, I'll add a new variable in the next version (which hopefully is the final release):  ^^num_flight_plans^^  You'll be able to use this anywhere on the page, even if you don't have a Flight Plan list on the same page.  For now though, if you just want to know if there are any plans at all, I think you can get away with checking to see if ^^flight_plan_id^^ is empty or not.

For the hop lists, there are two variables already in the latest beta:  ^^num_hop_list_completed_rows^^ and ^^num_hop_completed_rows^^.  They're just not being used anywhere at the moment.  Both are only available when there is a "Hop Completed" or "Hop List Completed" list on the same page.

I've also updated the Special Variables section of the Help page in the beta directory to show all this stuff:

http://www.chocolatesoftware.com/fshost/beta/?help.html#variables

Glad to see this stuff getting used!  :-)

Russell

PeterR

Thanks Russell. I'll wait for the ^^num_flight_plans^^ variable for my flight plans page.

Meanwhile, I'll make use of the ^^num_hop_list_completed_rows^^ and ^^num_hop_completed_rows^^ variables for the hop list page. These will be zero, not empty, when there are no entries, correct?

Just in case you're wondering, the reason I need these is to eliminate the "header only" look of the status pages when there's no content to be displayed. By knowing that there's nothing, I can put something instead.  ;D
Peter
Bush Flying Unlimited
"At home in the wild"

Russell Gilbert

Yes, they'll be zero if there are no rows (as long as you have the begin and end tags for those lists somewhere on the page -- otherwise they'll of course be empty).

Russell