R ravisemilo Member Licensed User Longtime User Nov 11, 2012 #1 First of all, this is my first post while trying to make my first application. I'm not a programmer by training and using this great tool B4A more as a hobby. Please excuse me if my questions are basic or silly. I'm trying to enter rows into a database table, one of the columns of which is month of the year. I have to insert 12 rows starting from April to March of next year. I was looking for some function like MonthName(i) so that I can loop from 1 to 12, instead of typing out all the months. I don't think the GetMonth will work for me as I don't have the ticks. Thanks Ravi
First of all, this is my first post while trying to make my first application. I'm not a programmer by training and using this great tool B4A more as a hobby. Please excuse me if my questions are basic or silly. I'm trying to enter rows into a database table, one of the columns of which is month of the year. I have to insert 12 rows starting from April to March of next year. I was looking for some function like MonthName(i) so that I can loop from 1 to 12, instead of typing out all the months. I don't think the GetMonth will work for me as I don't have the ticks. Thanks Ravi
M MLDev Active Member Licensed User Longtime User Nov 11, 2012 #2 You can do something like this: Code: Copy Dim MonthName() As String MonthName = Array As String("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") month = MonthName(0) ' month = "January" Upvote 0
You can do something like this: Code: Copy Dim MonthName() As String MonthName = Array As String("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December") month = MonthName(0) ' month = "January"
R ravisemilo Member Licensed User Longtime User Nov 12, 2012 #3 Thanks MLDev, I seem to have stuck up with date and calendar functions and missed the array. Works perfect. Ravi Upvote 0
Thanks MLDev, I seem to have stuck up with date and calendar functions and missed the array. Works perfect. Ravi