foreach_part reduced functionality

hi,

my Environment:
Windows7, 64bit, PD15.3, region: Germany

In a gtl-template I try using foreach_part - it seems to be
the first time. As documentation suggests I could have a
list of textstrings separated by any character. Additionally
there are several separator characters that are used by
default for iterating the parts of list.
The following happens:
I declare a list separated by ";".
I loop over the list using ";" as separator pattern.
Separator pattern is not used, so I get the whole list as
%CurrentPart%. Several attempts indicate nearly no
combination is resolved properly ( as described within
documentation ).
For better testing I declared a local separator variable and
a local separatorPattern variable.
Here is my code
{code}
..set_value(sep, #,new)
..set_value(sepPattern, "#=b0;^",new)
..set_value(hyph,"'",new)
..set_value(testList, "Standard%sep%Konto%sep%Kontostamm",
new)

..foreach_part(%testList%, %.Q:sepPattern%)
  %CurrentPart%
..next ("\n")

{code}

In the above example the output is:
Standard#Konto#Kontostamm
but should be:
Standard
Konto
Kontostamm

the only three functional combinations of %sep% and
%sepPattern%
have been:
sep : " " or "_" or "-" while sepPattern is not used:
{code}

..set_value(sep,"-",new)

..foreach_part(%testList%,,\n,\n)
  %CurrentPart%
..next ("\n")

{code}

I tried using sep and sepPattern with or without Quotes,
DoubleQuotes - nothing worked - except for very few
"designs".

Conclusion:
A separator pattern is not really used by PD. As default
only work part of documented "default" feature.
As separator are usable only the characters: " ", "_", "-"
This is very poor performance ( if I made no mistake )

I'm not sure, if this is a new bug ( mybe introduced in 15.2
or 15.3 ) or if it is an older one, but nobody have tried ?

any suggestions?
thanks in advance
Wilko
0
Wilko
1/6/2011 11:13:54 AM
sybase.powerdesigner.general 9408 articles. 1 followers. Follow

1 Replies
746 Views

Similar Articles

[PageSpeed] 21
Get it on Google Play
Get it on Apple App Store

hi,

found solutions.
1: syntax for spearator pattern
   - pattern has to be enclosed in single quotes.
   - a variable is not accepted

2. to use explicitely a local variable one has to build a
template like this:
{code}
..set_value(sep,#,new)
..set_value(sepPattern,%sep%,new)
..set_value(hyph,"'",new)
..set_value(chkList,"",new)
..set_value(testList,Standard%sep%Konto%sep%Kontostamm, new)
..//begin:
..set_value(run, "..foreach_part(%.Q:testList%,
%.q:sepPattern% ,,)\n\n\t%CurrentPart% \n\t.next",new)
..// use double evaluates
%!!run%

thanks everybody for getting involved
Wilko

{code}
> hi,
>
> my Environment:
> Windows7, 64bit, PD15.3, region: Germany
>
> In a gtl-template I try using foreach_part - it seems to
> be the first time. As documentation suggests I could have
> a list of textstrings separated by any character.
> Additionally there are several separator characters that
> are used by default for iterating the parts of list.
> The following happens:
> I declare a list separated by ";".
> I loop over the list using ";" as separator pattern.
> Separator pattern is not used, so I get the whole list as
> %CurrentPart%. Several attempts indicate nearly no
> combination is resolved properly ( as described within
> documentation ).
> For better testing I declared a local separator variable
> and a local separatorPattern variable.
> Here is my code
> {code}
> .set_value(sep, #,new)
> .set_value(sepPattern, "#=b0;^",new)
> .set_value(hyph,"'",new)
> .set_value(testList, "Standard%sep%Konto%sep%Kontostamm",
> new)
>
> .foreach_part(%testList%, %.Q:sepPattern%)
>   %CurrentPart%
> .next ("\n")
>
> {code}
>
> In the above example the output is:
> Standard#Konto#Kontostamm
> but should be:
> Standard
> Konto
> Kontostamm
>
> the only three functional combinations of %sep% and
> %sepPattern%
> have been:
> sep : " " or "_" or "-" while sepPattern is not used:
> {code}
>
> .set_value(sep,"-",new)
>
> .foreach_part(%testList%,,\n,\n)
>   %CurrentPart%
> .next ("\n")
>
> {code}
>
> I tried using sep and sepPattern with or without Quotes,
> DoubleQuotes - nothing worked - except for very few
> "designs".
>
> Conclusion:
> A separator pattern is not really used by PD. As default
> only work part of documented "default" feature.
> As separator are usable only the characters: " ", "_", "-"
> This is very poor performance ( if I made no mistake )
>
> I'm not sure, if this is a new bug ( mybe introduced in
> 15.2 or 15.3 ) or if it is an older one, but nobody have
> tried ?
>
> any suggestions?
> thanks in advance
> Wilko
0
Wilko
1/6/2011 3:37:43 PM
Reply:

Similar Artilces:

Function functionality ?
Hello, I have a Function : create Function F1 ........ as update T1 set col1=col1+1; commit; return col1; end; Lets say col1 value before the func. is called is 100. Now, if user1 executes this function and user2 also executes the same function, at the same time. 1) What value is returned for user1 and user2. Would that update stt. locks the table, and allows only 1 user to access it? 2) My requiemnent is that the 2 users should get different values from the function. thanks for your help -Sravan Sravan wrote... > Hello, > I have a F...

Reduced functionality
Name: P W MARSH Email: weareampmatgsinetdotnet Product: Thunderbird Summary: Reduced functionality Comments: I recently installed Thunderbird/3.0. Due to "features" added to ver. 2, I am now missing nearly one-third of my screen to duplicated features in the "Inbox - smart folders" function, losing even more space which could be better allocated to e-mail. How do I get rid of the duplicated buttons "reply," "reply all," "forward," "junk," and "delete"? How do I collapse the box under the listing of e...

Reduced functionality
Name: Alexander Popko Product: Firefox Summary: Reduced functionality Comments: I have been using Firefox for several years. It has worked well generally. When the system "upgraded" me from Firefox 2 to 3, surfing has slowed down, and some pages I regularly access no longer load properly. Case in point: http://www.heroquestcomics.com/events.html I want to go back to ff 2 until you get the bugs worked out. Where can I download ff2? [Macbook Pro, OS X.4] Browser Details: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/525.18 (KHTML, like Gecko...

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I ...

UserObjects, Functions and variables - access userobject functions from popupmenu
I have a visual userobject in charge of managing info related to different data in the application ( Items , company, purchase order,....) This user object has, in summary, - a datawindow to show the list of related documents, with a retrieval argument ( depending on the the related data ) - a popup menu on the rightbutton click, giving access to classical funstions like Create, modifiy, delete. - several functions, in particular, a function to retrieve the datawindow, according the argument passed by the parent window, and a function to delete a line, function in which a lot o...

general retry function
Hi Perlers, I have one nice question for you, I was run into common problem: need to repeat certain number of times something, until is succesful. For example - download webpage, FTP upload, connect to some host and so on. I ask you for some general (or it can't be possible - FTP upload) function, for example I will call: ftpupload($cfg, 10); will call ftpupload() with $cfg ($cfg->{user}, $cfg->{pass},...) and 10 is number of retries. Could be anyone so nice and write it ? I have some snippets here, using eval {} and catch errors with calling recursive sub, but I don&#...

FUNCTION INSIDE FUNCTION
 ok suppose i have two asp buttons....each button has its own code which executes after that button is clicked.....can i call  button1 function inside button2 function.....ie whenever button2 is clicked button1 should execute too......can i call a function inside another function ? Put the code of your button click event in a function and call that function in button2 click event after the button2 cllick event code. Or if you just want to execute the same code in both the buttons then just call the same event in both the button click event.Apurva Kaushal  thank u ....sorry...

General ASP.NET Functionality
I have been working with the DNN module for about two weeks.  I have some pages on our internal website that uses ASPOSE word, pdf, excel, etc...  I tried to build a DNN page that would render the results of the reports that are generated using the ASPOSE application.  I have been unsuccessful in this endeavor.  Can some explain to me how to convert exisiting ASP.NET pages and use them AS IS in the DNN module?  Is this possible?  Can you render word documents and render html generated by other applications?thanks for any replies or suggestions. This is a simil...

How to check if a native function is an internal function or an external function
Hello,all, In the JS interpreter, I found that some of internal object functions are also implemented as native functions. For example, js_NewStringCopyN(JSContext *cx, const jschar *s, size_t n), which is used to create a new String object. It should be an internal functions but is implemented as a native function. In the function js_Invoke(JSContext *cx, uintN argc, jsval *vp, uintN flags) of jsinterp.cpp, Is there any method for me to check whether a native function is an internal function or an external function? Here, external functions mean those that do not belong to Javasc...

Reduced functionality and SPP in Vista
http://www.computerworld.com/action/article.do?command=viewArticleBasic&articleId=9004970 <Quote from the article> Microsoft: A copy of Windows Vista can go into reduced functionality mode under two scenarios: 1. If any of the following events occurs (for each license type): Retail License (or corporate user with a MAK): a.. Failure to activate within the grace period (30 days after installation) b.. Failure to renew activation *** within three days of a major hardware replacement *** OEM License (or non-volume-license enterprise with OEM-sourced, preacti...

function name with in function?
Hi In ASP.NET (VB.NET) code-behind, While executing a function, how can I find programmatically which function I am in at that point of time? Function foo() as string ‘ Hey ! I am in function foo() End Function Please let me know. Thanks Pankaj How do you call the function?This posting is provided "AS IS" with no warranties, and confers no rights. Function call be called by any other function or sub. I think caller is irrelevant here. If you call that function by its name, just pass the name to the function to be called so you know where you are. Like this: ...

Print function not functional
Name: J. Michael Caruthers Email: mcaruthataoldotcom Product: Firefox Summary: Print function not functional Comments: With this current version of Firefox (3.6.10) I can no longer print from any site that I log-on to in the browser. For example, if I go to the AOL. site, I can't print a message either through AOL. itself or using the Firefox File/Print... tab. I can print normally in Windows IE or if I copy the message to MS Word (and print from there). I did not have this problem with earlier versions of Firefox. Browser Details: Mozilla/5.0 (Windows; U; Windows N...

General Question about extender functions
I have a general question about accessing functions that are tied to extenders.  I noticed that with some like the accordion and tab controls, if you are lucky you can $get the control, then use $find on the controls id (sometimes you need to add something like '_AccordionExtender' to get the additional functions).  But on controls like the TextBox watermark control I can't seem to get a handle on the additional functions.  Is there some kind of pattern to gain access to the control's additional functions or are they wrapped as private?     Leo Smi...

Generally pleased but .... import function?
Name: Chris Email: dabblerattelusdotnet Product: Firefox Summary: Generally pleased but .... import function? Comments: Unable to import Opera bookmarks, or any other settings. Appears that Firefox might be going after some incorrect or obsolete folders to find them? Running Windows XP Pro latest SP# and Firefox 3.5.3 Regards, Chris Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you ...

Web resources about - foreach_part reduced functionality - sybase.powerdesigner.general

PlayStation 2 online functionality - Wikipedia, the free encyclopedia
Selected games on Sony 's PlayStation 2 video game console offer online gaming or other online capabilities. Games that enable the feature provide ...

Free Messaging App MessageMe Latest To Lose Access To Facebook Find Friends Functionality
Facebook once again demonstrated that it does not believe imitation is the sincerest form of flattery, blocking access to its find friends functionality ...

FanAppz expands social CRM functionality, offers more insights about brand audience
... with their apps and putting those insights to use in other channels. The Personalized Marketing Platform builds upon the social CRM functionality ...

Reverting the changes to block functionality
Earlier today, we made a change to the way the “block” function of Twitter works. We have decided to revert the change after receiving feedback ...

Users want functionality without complexity with BYOD: Cortado
Mobile workers want to have access to their files while the move without the complexity, according to Cortado APAC sales manager, Brendan Samuels. ...

Apple takes password reset functionality offline after news of serious vulnerability
Earlier Friday, The Verge reported on a significant security exploit with Apple's "reset password" functionality for Apple IDs. Armed with only ...

Updated: Get Kinect-style functionality on your Mac with this free app
Flutter is a free app that brings gesture controls to your Mac via its built-in web cam. Get the download here.

Twitter bolsters search functionality - social media, social networking, Internet-based applications ...
Twitter will bolster search functionality to automatically complete users' queries and suggest related search terms, among other improvements ...

Google announces enhanced snooze functionality for Inbox by Gmail
Google today announced a useful new feature that is now available in its Inbox email app. Starting today, when users "snooze" an email that has ...

Parallels Access remote access app jumps from iPad to iPhone, gains Finder-like functionality
... capabilities of iOS devices by allowing them to serve as points of access to your Mac and Windows computers, and the intuitive and native functionality ...

Resources last updated: 12/27/2015 7:13:05 AM