Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding Sundays
Message
 
 
To
12/04/2000 16:55:30
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00358746
Message ID:
00359268
Views:
12
Cetin,

I checked yesterday mhHTMLCode, which is here in UT files section. It's an old incorrect version. Besides, Mike used unsophisticated algorithm. Instead of scan each all table of reserved words in each line, IMO, would be much faster to parse each string by words and analyze each word instead. In addition, it gives us flexibility to not insert formatting tags in string, like 'For some reason'.

I'm going to modify this program and then post it here, if nobody did it already...

>Just done to see that :) Nadya I bet you and Nick don't do all these tag additions to color syntax manually. More don't tell me that this is part of profile setup of your account, is it ?
>Cetin

>
>>Thanks, Cetin.
>>
>>Nice to know there are 5 Sundays in April :)
>>
>>>Well George I won the bet you found the errors :) Here is improved tested version :)
>>
>>********************************************************************
>>*  Description.......: GetDays 
>>*  Calling Samples...: GetDays()
>>*  Parameter List....: tnMonth, tnYear, tnDow, tnFDow
>>*  Created by........: Cetin Basoz 04/12/2000 04:38:18 PM 
>>*  Modified by.......: 
>>********************************************************************
>>lparameters tnMonth, tnYear, tnDow, tnFDow
>>tnFdow = iif(type("tnFdow")#"N",1,tnFdow)
>>tnDow = iif(type("tnDow")#"N",1,tnDow)
>>tnYear = iif(type("tnYear")#"N",year(date()),tnYear)
>>tnMonth = iif(type("tnMonth")#"N",month(date()),tnMonth)
>>ldStart=ctod("^"+str(tnYear,4)+"/"+padl(int(tnMonth),2,"0")+"/"+"01")
>>ldEnd = gomonth(ldStart,1)-day(gomonth(ldStart,1))
>>IF dow(ldStart,tnFdow) # tnDow
>>  ldStart = ldStart + (7 + tnDow - dow(ldStart,tnFdow))
>>ENDIF
>>for ix = 0 to day(ldEnd-1) step 7
>> if month(ldStart+ix)=month(ldStart)
>>    ? ldStart+ix, cdow(ldStart+ix), dow(ldStart+ix,tnFdow) = tnDow
>> endif
>>endfor
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform