DC_GetColArray() - suggestion

This forum is for eXpress++ general support.
Message
Author
User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

DC_GetColArray() - suggestion

#1 Post by Tom »

Hi, Roger.

I do use DC_GetColArray() intensively in the DATA codeblocks of all my array browers. But if those arrays are empty, maybe in a statistics module, all DC_GetColArray()-calls return empty strings. So now, I have to catch the length of the array source inside all codeblocks (DATA {||IF(Len(oBrowse:dataSource)>0,"--",DtoC(DC_GetColArray(1,oBrowse)))}), which is not very elegant. What about a forth parameter setting a DEFAULT value?

Code: Select all

FUNCTION DC_GetColArray( nElement, oBrowse, xVar, xDefault ) // here

LOCAL aArray, nPointer, xValue

DEFAULT xDefault := '' // here

aArray   := oBrowse:dataSource
nPointer := oBrowse:arrayElement

IF nPointer > Len(aArray) .OR. nPointer = 0
  RETURN xDefault // and here
ENDIF

IF nElement == NIL
  RETURN aArray[nPointer]
ELSEIF nElement <= 0
  RETURN nPointer
ENDIF

xValue := aArray[nPointer,nElement]

IF Valtype(xVar) == Valtype(xValue) // should work anyway
  aArray[nPointer,nElement] := xVar
ENDIF

RETURN aArray[nPointer,nElement]
My codeblocks could changed to this with a default for DC_GetColArray():

Code: Select all

DATA {||DtoC(DC_GetColArray(1,oBrowse,,EmptyDate()))}
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_GetColArray() - suggestion

#2 Post by rdonnay »

Tom -

That sounds like a good idea.
Did you test that code?
If so, I will copy it into my source for the next release.

Roger

BTW - Just upgraded my firmware in my Phantom 3 to support Way Points.
Going out today to test it. Today is a holiday here in the U.S. - Labor Day.
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DC_GetColArray() - suggestion

#3 Post by Tom »

Hi, Roger.

No, I didn't test this. I will do in the next days.

I'm going to install the P3 update on the weekend. Not only waypoints, but a relative flight mode and, wow!, "follow me". I'm going to find a cool location where I'm going to ride a bike and let the phantom fly behind. By the way, did you recognize that the camera will be able to shoot 2.7-K-videos with the update? That's quite cool!
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_GetColArray() - suggestion

#4 Post by rdonnay »

Not only waypoints, but a relative flight mode and, wow!, "follow me".
I know. This is cool stuff if it works.
By the way, did you recognize that the camera will be able to shoot 2.7-K-videos with the update? That's quite cool!
I saw that. I guess we are professionals now.
The eXpress train is coming - and it has more cars.

User avatar
Tom
Posts: 1176
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: DC_GetColArray() - suggestion

#5 Post by Tom »

I guess we are professionals now.
We are anyway. ;)

But. Mmh. If you say "She's a professional" in german, that has a very special meaning.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_GetColArray() - suggestion

#6 Post by rdonnay »

But. Mmh. If you say "She's a professional" in german, that has a very special meaning.
I hadn't thought of that. Ha.

I'm heading out now to my daughter's house. There's a lot of space out there to test out the new features.
Gonna strap the Phantom to my trike.
The eXpress train is coming - and it has more cars.

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: DC_GetColArray() - suggestion

#7 Post by RDalzell »

I am a big fan of the "Point of Interest"

Nice to see the feature set available to the Phantom 2 being brought forth to the 3.

Also, our Police Department just received our Aircraft Registration number from the FAA and will soon receive our official COA (required for government entity).

Been logging a lot of flight hours between my Phantom 3 and the Walkera Runner 250 (which you actually have to fly compared to the DJI).

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_GetColArray() - suggestion

#8 Post by rdonnay »

Hi Rick -

Well I loaded the software, but haven't had a chance to figure out the waypoint system yet.
No documentation.

I'm leaving on a 3-week trip tomorrow.

Going to see family, then on to Terry Wolfe's place followed by a weekend with Jim Graham on the lake.

Then on to my Navy reunion. I will capture lots of videos of my trip.
The eXpress train is coming - and it has more cars.

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: DC_GetColArray() - suggestion

#9 Post by RDalzell »

Enjoy your trip, if passing through the Windy City, I would love to have dinner again.

User avatar
rdonnay
Site Admin
Posts: 4734
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: DC_GetColArray() - suggestion

#10 Post by rdonnay »

I'm headed to minnesota and on to upstate ny. Not going thru Chicago. Wish you could come to Arizona devcon.
The eXpress train is coming - and it has more cars.

Post Reply