Jump to content

DimNull

Members
  • Posts

    13
  • Joined

  • Last visited

Posts posted by DimNull

  1. I'm new to this, so please bear with me. I'm trying to use the FormatCurrency Function to format a number located in a SQL Server 2k DB table. But I'm having a problem in defining the rules for the number. Basically, the number in the DB is "180792" (without quotes), and I want it transferred to "$1807.92". But my setup of this method is returning "$180,792".Here's more details on what I'm using, and what I'm trying to do:ORIGINAL DB VALUE:180792CURRENT CODE:Dim strNumber As String = Trim(rsQuery("Number").Value.ToString)strNumber = (FormatCurrency(strNumber,0))CURRENT RESULT:$180,792WANTED RESULT:$1,807.92I hope that someone can help me out with this one. I'm just not sure if this method has too many limitations that I can't use, or if I'm just not adding another few steps. Any and all help is appreciated. Thanks.
    Try something like this:
  2. Using an inline frame, and applying scrollbars to it:Or by using a frameset:(the red will be the place to define the dimensions of all frames, which you already know, but I don't know if you have them in a row or in a column)There is practically no difference between a frame without scrollbars that is longer than the page, or a frame that does is equal long to the window but with scrollbars. You always have to scroll! :) It would be fun if the page continues below your monitor, hea :)But applying the scrolling attribute is a better choice than making the frame longer than the page (I don't knoiw if that is even possible). If a frame is longer than the page, and you scroll to the bottom of the frame element, all other frames scroll to the top of the window too, and the main idea of frames was that all others stay on its place, lol :blink:
    :)

    The code below will actually hide frame "three". You will only see the two top frames. I used this once to display a counter without 'users' seeing it!

    :blink:

    <FRAMESET ROWS="100%,*" COLS="*" BORDER="0" FRAMESPACING="0" BORDERCOLOR="C0C0C0"><FRAMESET COLS="50%,50%" ROWS="*" BORDER="0" FRAMESPACING="0" BORDERCOLOR="C0C0C0"> <FRAME SRC="FileName1.html" FRAME NAME="one" SCROLLING="AUTO" NORESIZE> <FRAME SRC="FileName2.html" FRAME NAME="two" SCROLLING="AUTO" NORESIZE> </FRAMESET><FRAME SRC="FileName3.html" FRAME NAME="three" SCROLLING="AUTO" NORESIZE></FRAMESET>

  3. I think you have to calculate the day of the year from the current date. To do that, your have to write a function that gives the number of days for each month of the year regarding the bissextile years. Then write a function to determine which day of the year is the first day of the month based on the preceding one.Finally, calculate the day of the year regarding the difference between the day of the month and the first day of the month.
    Frankly the day of the year is referred to as the "Julian Date", and since 01/01/xx is the first day of the year, not the zero day of the year, you can simply just subtract the current date from 01/01/xx and it will give you the Julian date--BUT-- it will be off by one day. So you need to place a fix: Now() + 1, because if you subtract 0 from any number you will generate an error in code. You are going at it too hard. The code language knows how many days there are in each month, so you don't have to factor that in. It knows when the year is a leap year too by the simple rule: it is a leap year if the year is divisible by 4, no remainder, except if it divisible by 100, no remainder, except if it is divisible by 400, no remainder. See pretty much everything you mention is already taken care of in the code language that u use. :)
    <script language="VBScript"><!--MyYear = "1/1/" & Right(Year(Now),2)DiffADate = "Julian Date: " & DateDiff("d", MyYear, Now) + 1document.Write(DiffADate & "<br />")//--></script>

    Run this script and check against this web site:http://daac.gsfc.nasa.gov/julian_calendar.shtml><> ><> ><> ><> ><> ><> ><> ><> ><>

  4. You would use window.open() for that, namely in a script attribute (the onclick) or a function defined in the header section. :)Or
    I have a custom popup maker at:http://whytehouse.com/custom-popup-win.aspI am not touting anything here. You may copy the html source code for your own use. I got the script from echoecho.com, and added the top and left variables.Or just copy and paste this into a web page:
    <script LANGUAGE="JAVASCRIPT"><!-- function MakeNewWindow(){result=new Array(7);for (i=1; i<=7; i++){result[i]="no"};with (document.popup){if (R1[0].checked) {result[1]="yes"};if (R2[0].checked) {result[2]="yes"};if (R3[0].checked) {result[3]="yes"};if (R4[0].checked) {result[4]="yes"};if (R5[0].checked) {result[5]="yes"};if (R6[0].checked) {result[6]="yes"};if (R7[0].checked) {result[7]="yes"};settings="toolbar="+result[1]+",location="+result[2]+",directories="+result[3]+",status="+result[4]+",menubar="+result[5]+",scrollbars="+result[6]+",resizable="+result[7]+",width="+newwidth.value+",height="+newheight.value+",top="+tops.value+",left="+left.value;NewWindow=window.open(url.value, "NewWindow", settings);code.value="\<a href=\"#\" onClick=\"NewWindow=window.open(\'"+url.value+"\',\'NewWindow\',\'"+settings+"\')\;\">,Place Your Linktext Here</a>";}}//--></script><script LANGUAGE="JAVASCRIPT"><!-- function ClearWindow(){with (document.popup)code.value="";}//--></script></head><body><H1><font color="#804000">Online Pop-Up-Coder</font></H1><H4>Enter the url of the page you want to pop-up,<BR>click the desired settings and press the Check Popup-button.</H4><H4>Play with the settings until the<BR>window pops-up exactly as you want it to.</H4><H4>Once you are content with the pop-up-window<BR>you can copy and paste the code to your own page.</H4><form name="popup"><table border="1" BORDERCOLOR=804000 WIDTH=40%><tr><td bgcolor=804000 colspan="2" align=center><font color=FFFFD3><strong>Page To Open In New Window</strong></font></td></tr><tr><td bgcolor=8C7853 colspan="2" align=center><input type="text" name="url" size="30" value="http://www.echoecho.com"></td></tr><tr><td bgcolor=804000 colspan="2" align=center><font color=FFFFD3><strong>New Window Settings</strong></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>toolbar = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes<input type="radio" value="V15" name="R1" checked>| no<input type="radio" name="R1" value="V16"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>location = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V17" name="R2" checked>| no<input type="radio" name="R2" value="V18"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>directories = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V19" name="R3" checked>| no<input type="radio" name="R3" value="V20"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>status = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V21" name="R4" checked>| no<input type="radio" name="R4" value="V22"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>menubar = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V23" name="R5" checked>| no<input type="radio" name="R5" value="V24"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>scrollbars = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V25" name="R6" checked>| no<input type="radio" name="R6" value="V26"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>resizable = </font></td><td bgcolor=8C7853 align=center><font color=000000>yes <input type="radio" value="V27" checked name="R7">| no<input type="radio" name="R7" value="V28"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>width = </font></td><td bgcolor=8C7853 align=center><font color=000000><input type="text" name="newwidth" size="3" value="600"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>height =  </font></td><td bgcolor=8C7853 align=center><font color=000000><input type="text" name="newheight" size="3" value="450"></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>top =  </font></td><td bgcolor=8C7853 align=center><font color=000000><input type="text" name="tops" size="3" value=""></font></td></tr><tr><td bgcolor=8C7853 align=center><font color=000000>left =  </font></td><td bgcolor=8C7853 align=center><font color=000000><input type="text" name="left" size="3" value=""></font></td></tr><tr><td colspan="2" bgcolor=804000 align=center><P><input TYPE="button" value="Check Popup-Button" name="B1" OnClick="MakeNewWindow()"><P><input type="reset" value="  Click here to Reset  " name="B2" OnClick="ClearWindow()"></td></tr></table><p align=center><strong>This is the code generated from the above test:</strong></p><P align=center><textarea rows="8" name="code" cols="60" wrap="physical"></textarea></p><H5><font color=804000>Note:</font><br>The code should be pasted into the <a href> tag of the link<BR>you want to trigger the popupwindow. In the example we named<BR>the window "New Window". If you have more than one popup-window<BR>on the same page you need to rename the window names. Use for<BR>example "New Window1", "New Window2" etc.</H5>

  5. Here's the situation:I'm trying to figure out a way to get the users screen resolution and pass it to asp. I can do it in JavaScript and VBscript within the html doc., but then I think I would like to pass this back to the server so I can dynamically change the width of a table or td, etc. etc.

    <script language="JavaScript"><!--function myscreen(){var version;var width;var w;browserName=navigator.appName;browserVer=parseInt(navigator.appVersion);if ((browserVer >= 4 & browserName == "Netscape") | (browserVer >= 4 & browserName == "Microsoft Internet Explorer"))version="4";elseversion="3";if (version=="4")width = screen.width;if (width < 801)w = 115;elsew = 0;return(w);}//--></script></head><body><script language="JavaScript"><!--document.write("<td width=\"" + myscreen() + "\" >")//--></script>OR:<script language="vbscript"><!--Dim wDim widthwidth = window.screen.widthIf width < 801 Thenw = 0Elseif width > 800 Thenw = 115End Ifdocument.write("<td width=""" + w + """>")//--></script>

    I think the best way to do this is through asp, and the width would be written BEFORE the page is sent, so I would need to get the user's screen width from the user's previous page view :)) Any Ideas???

  6. Try this....<%dim strDateTimestrDateTime = Now()strPastDay = #01/01#%><%=INT(strDateTime - strPastDay) %>
    I believe if you subtract 01/01 from the date today you will get the wrong Julian date. Example: if you subtract jan 1 from jan 15, you get 14, however jan 15 is the 15 day of the year!So:strDateTime = Now() + 1 would seem to be the answer as 01/00 will give you an error.
  7. I want to search a string and display any matches with the search word in a web page. Now using the Replace function will not do as it will replace the word but not keep the original word in the text, i.e., if search word is fear and the match in the string is Fear, it will change the punctuation from cap to lower and visa versa. So I created some code to find where the match(es) occur and replace the original word with formated html code around the matched word to have it appear highlighted. The problem is that fear will match fearless, much like the find function in Word for example. If I add a space before and after the search word, well that almost works. But does not allow for puctuation after the search word or if the search word is the first word in the string. So anybody know how to do this?Here is the code I worked out so far (You can run it in a web page for test purposes, although I intend to use in asp).<code><html><head><title>test search</title><body bgcolor="ffffff" text="000000"> <script language=vbscript><!--' Mid(string, start[, length])' Left(string, length)' Right(string, length)' InStr([start, ]string1, string2[, compare])' string2 is not found = 0' start > Len(string2)= 0MyString = "The quick brown dog jumps over the other ""dogs"". A Dog or Dogs will do that from time to time. My Dog will not though. Of course in you are dogless, well..." VarWord = "dog"document.write "MyString = " & MyString & "<br />"document.write "VarWord = " & VarWord & "<br />" & "<br />" & "<br />"document.write "_________________________________________" & "<br />" & "<br />" & "<br />"MyNumber = 1MyVarNum = Len(VarWord)' This pulls out the first part of the string and first match and the formated web page codeMyNumber = InStr(MyNumber,MyString,VarWord,1)MyStr = Mid(MyString, 1, MyNumber-1) & "<font color=red><b><u>" & Mid(MyString, MyNumber ,len(VarWord)) & "</u></b></font>"MyNum2 = MyNumberDo MyNumber = InStr((MyNum2 + 1),MyString,VarWord,1)' This pulls out the last part of the string if the is only one match and skips to the "elseif"' if there is more than one match.If MyNumber = 0 ThenMyStr = MyStr & Right(MyString, Len(MyString) - ((MyNum2 + MyVarNum) - 1)) & "<br />"Exit Do' This pulls out subsequient matches in the stringElseIf MyNumber > 1 ThenMyStr = MyStr & Mid(MyString, MyNum2 + Len(VarWord), MyNumber - (Len(VarWord)) - MyNum2) & "<font color=red><b><u>" & Mid(MyString, MyNumber ,len(VarWord)) & "</u></b></font>"MyNum2 = MyNumberEnd IfLoop document.write MyStr--></script></body></html></code>

×
×
  • Create New...