出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[5605] Re:ありがとうございす。教えの通り関数でやって、ちゃんと表示されたのですが・・・・・ |
投稿者:Lightningさん 2006/01/20 14:40:10 |
あははは、こりゃ、簡略化したいですね。 こんなときこそSelectCase文ですよ! VB系のSelectCaseはC系のSwitchと違い、int以外も振り分けに使えると言う強みを持っています。 だから、たとえば If DateSerial(iyear,imonth,idate)= DateSerial(iyear,1,1) Then Response.Write "<font color=red>"& idate &"<font size = 2>"&"元旦"&"</font>" & "</font>" Else IF DateSerial(iyear,imonth,idate)= DateSerial(iyear,1,15-Weekday(Dateserial(iyear,1,1)-2)) Then Response.Write "<font color=red>"& idate & "<font size = 2>"&"成人の日"&"</font>" & "</font>" Else If DateSerial(iyear,imonth,idate)= DateSerial(iyear,2,11) Then Response.Write "<font color=red>"& idate & "<font size = 2>" & "建国記念日 " & "</font>" & "</font>" 以下略 とかだと select case DateSerial(iyear,imonth,idate) case DateSerial(iyear,1,1) 略 case DateSerial(iyear,1,15-Weekday(Dateserial(iyear,1,1)-2)) 略 case DateSerial(iyear,2,11) 以下略 という使い方が出来るのでとても便利です。 後は、たまに私がやるのですが Resopnse.write を %> <%で代用する方法。 文頭が%>文が終わると<%になるので以外にみやすかったりしますが、諸刃の剣です。 #変数代入時にミスることがあるし とかでどーでしょw |
![]() ![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
TreeBBS For ASP V.0.1.3 |