Diccionario de coincidencia de tipos en VBScript
-
22-09-2019 - |
Pregunta
El error que estoy recibiendo es: No coinciden los tipos: las hojas de estilo ''
hojas de estilo se define como:
sub stylesheets(collection)
for each key in collection.Keys
response.write(stylesheet(key, collection.Item(key)))
next
end sub
' returns a link tag for each object in the collection
function stylesheet(asset, media_type)
if (media_type="") then
media_type="screen"
end if
return "<link href=""" & asset_url(asset) & """ type=""text/css"" media=""" _
& media_type & """ />"
end function
Y está siendo llamado como tal:
<% stylesheets(site_stylesheets) %>
Donde site_stylesheets ha sido definida como:
' stylesheets is a collection of the stylesheets to be included on all pages
Set site_stylesheets = CreateObject("Scripting.Dictionary")
site_stylesheets.Add "css/endoworks.css", "screen"
Ha sido un largo tiempo desde que he hecho cualquier VBScript-ción. Te lo agradecería cualquier ayuda.
Solución 2
Acabé colocando la lógica de bucle de stylesheets
en el sub header
[rutina]. Funciona bien ahora.
@ Tester101:. Probé sus sugerencias, pero no fijó el problema
Editar: En realidad descubrí que tenía un argumento stylesheets
en la subrutina header
que es donde se llama el sub stylesheets
. Por lo que estaba tratando de ejecutar nothing
con un argumento de site_stylesheets. No puedo creer que me perdí.
Otros consejos
Trate de remover el paréntesis al llamar hojas de estilo. ver esta pregunta para más información. No creo que se puede usar paréntesis cuando se llama a un sub con un solo parámetro.
Probar
<% stylesheets site_stylesheets %>
o este
<% call stylesheets(site_stylesheets) %>