You guys seem pretty helpful in other posts, and im hoping you can give me some advice.
I have been presented an opportunity as a navision developer. However i have never had a programming job as a primary responsibility. That is not to say i have not done programming, but just not on a full time professional level. I have been playing with asp almost since its inception. Anyone remember IDC/IDQ pages?
This prospective employer would like me to be producing usable code within 2-3 weeks.
With that said, I am trying to weigh my current knowlege against what i am up against. The last thing we both want is to waste each others time.
I will post some code below that took me about a week to write, debug, enhance, tune and go live. Im hoping that may shed some light on my skill and whether or not i "Should" be able to make the transition to navision and be useful. I realize this is probably unorthodox, but in reality im not sure how else to size up my ability. I come from an architecture/infrastructure background so this is essentially a career change for me.
Look forward to your responses.
dim usedads(9)' sets up the used ads reference array. This only allows 10 ads per page.
adctr = 0
function getAD (size,section)
Set objXML = Server.CreateObject("Microsoft.XMLDOM") ' creating an object of XMLDOM
' Locate and load xml file based on passed variable
backupint = ubound(split(request.servervariables("path_info"),"/")) -1
addstr = "../"
do while not backupint = 0
backupstr = backupstr & addstr
backupint = backupint -1
getxml = backupstr & "includes/bannerad_" & section & ".xml"
' checking for error on file existance
If objXML.parseError.errorCode <> 0 Then
Response.Write "<p><font color=red>Error loading XML Banner file.</font></p>"
Set objLst = objXML.getElementsByTagName(size) ' refer to Resource "banner_ad" in the xml file
'randomize ad to be shown and check for start & stop dates, and dont display duplicate ads
arraystr = join(usedads) ' pull already used ads from the array to verify against
killctr = 0 ' set kill ctr to 0
do until startdate <= date and expiredate >= date and usedadstr = "0"
showbanner = int((objLst.length * rnd))
startdate = cdate(objLst.item(showbanner).childNodes(7).text )
expiredate = cdate(objLst.item(showbanner).childNodes(8).text)
adnamestr = objLst.item(showbanner).childNodes(6).text
usedadstr = instr(arraystr,adnamestr) ' usedadstr will return 0 if it is a unique ad, otherwise will return position in which name was found
if killctr = 30 then exit do 'kill loop if i cant find any valid ads. will pick one at random and return. Note: it will be a duplicate.
killctr = killctr + 1
'response.write "startdate is:" & startdate & "end date is: " & expiredate & " current date is: " & date & "<BR>"
Set subLst = objLst.item(showbanner) 'Set the sublist to the parent object
' refer to sub-items of banner_ad|bannersize in the xml file
' sublst.childnodes(0) = <Banner_name> obvious
' sublst.childnodes(1) = <image_path> absolute or relative path to the image
' sublst.childnodes(2) = <to_url> to_url is the redirecting url I.E. exitsite.asp or equivelant
' sublst.childnodes(3) = <dest_url> final url to send the user to
' sublst.childnodes(4) = <alt_text> The images alternate text
' sublst.childnodes(5) = <sourcecode> Not used at this time but could be shortly
' sublst.childnodes(6) = <wtadname> refers to the WT.ad and WT.ac value
' sublst.childnodes(7) = <start> the banners start date
' sublst.childnodes(8) = <expire> the banners expiration date
banimg = subLst.childNodes(1).Text
banurl = subLst.childNodes(2).Text
desturl = subLst.childNodes(3).Text
Alttxt = subLst.childNodes(4).Text
bansrccode = subLst.childNodes(5).Text
WTAD = subLst.childNodes(6).Text
'WTADHREF = "<a href=" & banurl & "?wtc=" & WTAD & "&exitcode=" & bansrccode &"&url=" & server.urlencode(desturl) &"><img src=" & banimg &" border=0 alt=""" & alttxt & """></a>"
WTADHREF = "<a href=" & banurl & "?wtc=" & WTAD & "&url=" & server.urlencode(desturl) &"><img src=" & banimg &" border=0 alt=""" & alttxt & """></a>"
adDetails(0) = WTAD
adDetails(1) = WTADHREF
getAd = adDetails
usedads(adctr) = adnamestr
adctr = adctr +1
Set objXML = nothing
Set subLst = nothing
Set objLst = nothing
on error resume next
getsize = size
getsection = section
adnum = stradnum
adfillin = getAd(getsize,getsection)
response.write "<meta name=""WT.ad"" content=""" &adfillin(0) & """>"
response.write "<img src=/images/bnr_ad_tag.gif border=0 width=14 height=60>"