I want to print Alphabets from A to Z can anyone help me how can i achive this.please
Hello Shubham Kushwah, I'm sorry, I'm not sure which question you are referring to . Could you please clarify or provide more context? Best regards,
Ana
Like in input if give value J then A to J alphabets i need to print
So, if I understand correctly, you want to print the letters of the alphabet from A to the input letter, inclusive. For example, if the input is "J", then you want to print:
A B C D E F G H I J
Is that correct?
Yes
Okay, so, one way of doing this (maybe not the straightforward and easiest one, but the one I'm thinking of) you can create a static entity with the alphabetic letters (don't use auto-number). After that, on change of the input (remember to limit the number of characters in that input to only one letter if the case) you can filter the alphabetic entity and print the ones until the letter you desired. You first identify the Id or the order of the letter you put on the input and after you go to the aggregate and filter the entity by the order/id previous found.
Once more, there could be a simpler and more straightforward approach, but it is not coming to mind presently. Best regards,
Hi Shubham,
Create one static entity and add all A to Z alphabets and order should be same like for A order field of static entity should be 1, fo B -2 ........for Z-26 and label should be A,B,C...Z
On screen create one local variable of Type Text-list,add this list onscreen below input .Add one integer local variable named MaxRecord. Add aggregate of static entity which will be sorted based on order, setfetch property to on-demand and max record to MaxRecord variable
When user gives input lets say D and click on button, you have to match the input to the label of Static entity and get the order of that record, In this case it will be 4, assign this value to max record,refresh the aggregate, take for each pass the aggregate list as source and for each iteration append the label to local text list.
This will show A B C D on screen for D as input.
One thing to consider in this solution serverside logic is involve so perfomance-wise this will not be good solution. but if performance is not that important to you then this will work.
hi @Shubham kushwah if you want print a to z using loop you can do like that where i use two variable
1 is "start" which is integer type var and default value should be 65
and 2 one is alphabet var is text type.
Here is a very simple JavaScript solution:
var alphabets = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var selectedCharacter = 'J';
var index = alphabets.indexOf(selectedCharacter);
if (index > -1) {
var alphabetsToPrint = alphabets.substr(0, index + 1);
//Here you can use split function to store characters in array. For example:
//var charactersToPrint = alphabetsToPrint.split('');
console.log(alphabetsToPrint.split('').join(', '));
} else {
console.log('Invalid character');
}
You can convert the above snippet in a client action as well.
You can initialize the Starting Number after taking the ASCII value of the character.
I am attaching the OML file, you can take reference.
Hi,
I've seen that many solutions have been provided, but here's what I would do with the requirements you mentioned in the question and in your answer to Ana Agostinho:
I've included the OML for you to check
One of the approach would be to use an expression widget with the below value.
If(CharInputVar = "", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", Substr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, Index("ABCDEFGHIJKLMNOPQRSTUVWXYZ", ToUpper(CharInputVar)) + 1))
Note: CharInputVar local variable is mapped with the input widget.
If you want to get the result in List - Convert the processed output string to List using the String_Split server action (with "" separator).
Demo: ExtractAlpha
Kind regards,
Benjith Sam
I was going to give an answer like this, but I would initialize a local variable to have the alphabet, so you can reference that instead of hardcoding it three times :).
Ah! I missed it. That's indeed a good suggestion. Thank you Kilian :)
Hi Shubham kushwah,
Please use client-side script Javascript and achive it.
https://www.geeksforgeeks.org/javascript-program-to-print-alphabets-from-a-to-z-using-loop/
Thanks,
Ramesh